ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Transfer save files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transfer save files

    We have stopped using FTP for security reasons and are using SFTP instead. FTP was the way I transferred save files between the iSeries and PC's. Is there a another way I can do this?

  • #2
    Re: Transfer save files

    You can use the CPYTOSTMF command to convert your save files into stream files (and use CPYFRMSTMF to convert them back.)

    Once converted, you can copy them with SFTP, Windows Networking, NFS, or even HTTP if you desire.

    Comment


    • #3
      Re: Transfer save files

      I've done savefile transfers through IFS streamfiles for many years and have thought it's been the easiest way to do it. To start, here are two basic commands that convert a savefile to a streamfile and back to a savefile:
      Code:
      CPYTOSTMF FROMMBR( '/qsys.lib/mylib.lib/mysavf.file' ) TOSTMF( mysavf.savf ) STMFOPT( *REPLACE )
      CPYFRMSTMF FROMSTMF( mysavf.savf ) TOMBR( '/qsys.lib/mylib.lib/mysavf.file' ) MBROPT( *REPLACE )
      I always use a *.SAVF extension for streamfiles because the system recognizes it and does things automatically for me. There is no need to create a savefile; it's handled because of the *.SAVF extension. Similarly, there's no need for a *.MBR extension for the FROMMBR() nor TOMBR() parameters since savefiles don't have multiple members.

      The two examples use relative paths to write to or read from the job's current directory, but absolute paths work the same.

      I almost always have a savefile named SAVF in my current library. I use it regularly as a quick way to store or retrieve saved items. You can create a savefile, save something into it, run the two commands (after setting the names appropriately) and review the results. If you change the name for the TOMBR() parameter when you run CPYFRMSTMF, you can compare the result to the original. I keep copies of the commands in "CL" source members for easy copy/paste.

      Once in a streamfile in a shared directory, it's easy to drag/drop from a PC, to transfer with sftp or to manipulate in other ways. As long as the *.SAVF extension is kept and you don't pass it through methods that will try to do EBCDIC/ASCII or other conversions, there's really very little that needs to be done.
      Tom

      There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

      Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

      Comment


      • #4
        Re: Transfer save files

        What is the reason to convert save files to stream files? You can use FTP,SFTP,HTTP etc to directly access Save files via IFS like in toms first line above...

        Comment


        • #5
          Re: Transfer save files

          For me, it's often because I don't often have FTP methods at all. Such servers might not be active. But I can almost always access specific shared directories to use simple copy/paste methods for network movement. Without something like a FTP server (and other times even sftp) to give IFS naming to the outside, it doesn't matter if such a server can do it.

          At times it's for archiving, other times to carry on a flash drive or other means.

          I can get it into a form handy for PC/UNIX/Linux manipulation all on my system. And it's just simple, is all there is to it. If FTP/sftp can be easily used, there might be no reason.
          Tom

          There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

          Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

          Comment


          • #6
            Re: Transfer save files

            Scott and tomliotta, thank you for your help.

            holgerscherer, will you provide more detail? The only files I see in QSYS.LIB with my SFTP client are physical files.

            Comment


            • #7
              Re: Transfer save files

              It'd be unusual to access files directly in "QSYS.LIB", but maybe it's just unclear. By itself, "QSYS.LIB" mostly refers to the QSYS library. But it's also a reference to the /QSYS.LIB file system, and all libraries are accessed as subdirectories under /QSYS.LIB.

              If you have a file in a library named QGPL, it would appear under the /QSYS.LIB/QGPL.LIB path. If you have a savefile named MYSAVF in library LBURKETT, the path to it would be /QSYS.LIB/LBURKETT.LIB/MYSAVF.FILE.
              Tom

              There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

              Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

              Comment


              • #8
                Re: Transfer save files

                Did you check /QSYS.LIB/YOURLIB.LIB ?

                Comment


                • #9
                  Re: Transfer save files

                  Your reply questioned the need to copy a save file to a stream file, that it was directly accessible using SFTP. In my question to you I said I could only see physical files in qsys.lib, not save files. When I said qsys.lib I was referring to the entire qsys file system. Again, what method do you use to observe save files in the qsys file system using SFTP?

                  Comment

                  Working...
                  X