ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Transferring Save file

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

  • Transferring Save file

    Hi,

    Can anyone please let me know how to transer a save file to AS400.

    Thanks,
    Vivek

  • #2
    Re: Transferring Save file

    Hi vivek!

    What is a save file?
    Thanks

    Comment


    • #3
      Re: Transferring Save file

      Satheesh,

      Save files are special type of files used for transferring AS/400 objects (a file or a library). It can be compared to a Zip file AFAIK. You can create a save file using the command CRTSAVF

      Comment


      • #4
        Re: Transferring Save file

        Suppose u want to transfer source code from one server to another ,,then u will go for FTP..
        if want to transfer objects from one server to another server then u need to save that object as save file and do the FTP to another server ( that save file) ,,,after doing FTP to another server ,, then use restore save file on the second server..

        Comment


        • #5
          Re: Transferring Save file

          Hi

          Tape may be usefull to
          LP Zdenko

          Comment


          • #6
            Re: Transferring Save file

            Hi Pavan/Zdenko,

            To make things clear i have save file in my PC say c:\testsv.savf. I want this to be transferred to library 'vivek'. I 'm using client access software. The option of send files to host always throws some error. Can you help me on how to get around this?

            Thanks,
            Vivek

            Comment


            • #7
              Re: Transferring Save file

              Hi

              Be sure to create *SAVF in *LIB VIVEK, before You try FTP.
              LP Zdenko

              Comment


              • #8
                Re: Transferring Save file

                Hi Vivek...

                do the FTP of the save file to ur local server( i guess u know that) ...then it will become stream file..
                The Copy From Stream File (CPYFRMSTMF) command copies the data in a stream file to either a database file member or a save file.

                The save-file-path-name must be of the form name.object-type. For example, /QSYS.LIB/LIBA.LIB/SAVEFILEA.FILE is the form required by the QSYS.LIB file system.


                give ur lib @ LIBA

                so many ways to this,..
                let me know if u reqiure more inf..

                Thanks
                Pavan Pokala

                Comment


                • #9
                  Re: Transferring Save file

                  Thanks Pavan. Your info was of great help to me.

                  Comment


                  • #10
                    Re: Transferring Save file

                    Create the SAVF "testsv" on the iseries

                    BIN
                    cd yourlib
                    PUT c:\testsv.savf
                    QUIT

                    Comment


                    • #11
                      Re: Transferring Save file

                      You could also use zipseries, it's free and can be found at www.zipseries.com.

                      ZipSeries do all the FTP stuff for you automatically

                      Bent

                      Comment


                      • #12
                        Re: Transferring Save file

                        1. Binary is best. -- For speed and accuracy, always choose Binary mode
                        (TYPE I, or Image) FTP transfers between your AS/400s.
                        Binary mode is specified by using the BIN FTP subcommand
                        in your FTP session, as follows:

                        PHP Code:
                         BIN 
                        For more recent OS/400 versions, FTP may force you to use binary mode before
                        it will transfer a save file.

                        Binary mode is called an Image transfer for good reason. Binary transfers
                        mean that OS/400 FTP will create an exact mirror image of your save file
                        on your target machine. The file is transferred bit-by-bit, and it is
                        reassembled on the receiving machine exactly as it looks on the sending
                        machine, with no EBCDIC translation performed. Incidentally, this also
                        helps speed up your FTP transfer.

                        2. FTP sometimes creates your target save files correctly. -- This is where
                        most people trying to FTP save files get tripped up: through mistakes
                        caused by not understanding how FTP automatically creates save files on
                        the target machine. There are two ways to insure that your save file is
                        correctly created on your target machine, and the method you choose is
                        dependent on how you specify the NAMEFMT parameter in your FTP session.

                        If you use NAMEFMT 0 in your FTP transfer -- where OS/400 libraries and
                        objects are defined in a library/filename format -- the save file must
                        already be present on your target system before the transfer begins,
                        and it must also be identified to OS/400 as a save file. If the target
                        save file isn't present, OS/400 will not transfer the file correctly
                        and it will probably create a physical file, not a save file, to hold
                        the results of your transfer. For NAMEFMT 0 transfers, you can use the
                        Create Save File (Create Save File) command as follows to create the
                        receiving save file on your target machine before the FTP session begins:

                        PHP Code:
                        CRTSAVF FILE(TECHTARGET/FILENAMETEXT('Save file for target machine'
                        Alternatively, an FTP client session can also create a save file on the
                        target machine by using the FTP Remote Command sub-command (RCMD),
                        which executes an OS/400 command on a remote machine. Here's an example
                        of how you could create the same save file on a remote FTP host by using
                        the RCMD command inside your session:

                        PHP Code:
                        QUOTE RCMD CRTSAVF FILE(TECHTARGET/JOETEXT('Save file for target machine'
                        If you have the proper authority, any command that follows the 'QUOTE RCMD'
                        string will be executed on the host AS/400 as if it were typed in on a
                        command line. This is handy for executing almost any OS/400 command from
                        inside an FTP session.

                        For FTP sessions that are run under NAMEFMT 1 -- where OS/400 file names
                        are defined in the Integrated File System (IFS) format -- FTP will automatically
                        create your save file correctly on the target machine when you fulfill two
                        conditions: 1. You must use the IFS naming convention for your save file on
                        your GET, MGET, PUT or MPUT sub-commands. 2. You must specify a .SAVF extension
                        for the file being transferred. Here's what a simple PUT command would look
                        like when transferring a save file in a NAMEFMT 1 FTP session:

                        PHP Code:
                        PUT /QSYS.LIB/HERTVIK.LIB/JOE.SAVF /QSYS.LIB/TECHTARGET.LIB/JOE.SAVF 
                        Because you specified the file as a save file (.SAVF), FTP will properly
                        create the save file on your target machine -- if it's not already present --
                        using the target name specified in your PUT statement. Using PUT (or MPUT)
                        in a NAMEFMT 1 session this way bypasses the need to create a new save file
                        on your target system before the save is started.

                        3. An empty target save file is a beautiful thing. -- For transferring save
                        files, an existing target save file must also be empty for the transfer
                        to succeed. That means the file must either be newly created
                        (through the CRTSAVF command or PUT technique as shown above) or you must
                        clear the target save file before starting the transfer. You clear the target
                        file by using the Clear Save File (CLRSAVF) command before the transfer
                        begins, as follows:

                        PHP Code:
                        CLRSAVF FILE(TECHTARGET/JOE
                        Or you can execute this command inside your FTP session by, again, using the
                        FTP RCMD sub-command:

                        PHP Code:
                        QUOTE RCMD CLRSAVF FILE(TECHTARGET/JOE
                        Either of those techniques will allow the target save file to be cleared,
                        which will make for a successful transfer.

                        Given these rules, here's two FTP scripts that show how you would transfer the
                        same save file from one AS/400 to another using either the NAMEFMT 0 or NAMEFMT 1
                        file naming conventions.

                        For a NAMEFMT 0 FTP transfer, a typical FTP save file transfer might use these
                        commands:
                        PHP Code:
                        NAMEFMT 0
                        BIN
                        QUOTE RCMD CRTSAVF FILE
                        (TECHTARGET/JOETEXT('Save file for target machine')
                        QUOTE RCMD CLRSAVF FILE(TECHTARGET/JOE)
                        PUT HERTVIK/JOE  TECHTARGET/JOE
                        QUIT 
                        In this case, you may decide not to use both the CRTSAVF and CLRSAVF commands
                        together, but I put them in this session sample for illustration.

                        For a NAMEFMT 1 FTP transfer, a typical FTP save file transfer might
                        use these commands:

                        PHP Code:
                        NAMEFMT 1
                        BIN
                        PUT 
                        /QSYS.LIB/HERTVIK.LIB/JOE.SAVF /QSYS.LIB/TECHTARGET.LIB/JOE.SAVF
                        QUIT 
                        also just cause I do this then there is no need for clearing.
                        PHP Code:
                        PUT /QSYS.LIB/HERTVIK.LIB/JOE.SAVF /QSYS.LIB/TECHTARGET.LIB/JOE.SAVF  (replace 
                        You could also execute the CLRSAVF command through QUOTE RCMD if the save
                        file already exists on your target and it needs to be cleared before the
                        transfer. Using a NAMEFMT 1 transfer makes it easier to create save files
                        on your target system, but you have to code your GET, MGET, PUT and MPUT
                        commands to proper specify file names in the IFS naming convention.
                        All my answers were extracted from the "Big Dummy's Guide to the As400"
                        and I take no responsibility for any of them.

                        www.code400.com

                        Comment


                        • #13
                          Re: Transferring Save file

                          One more issue we usually face while dealing with Save file is due to version. Say you have 2 systems between which the SAVF transfer is happening with 2 diff versions say V5R3 and V5R1 and you are doing a SAVOBJ in V5R3 machine and RSTOBJ (after FTP) in the V5R1 machine then while doing the SAVOBJ you have to mention the version as V5R1M0 otherwise you ll have issues while restoring the object in V5R1 machine.

                          Initially while dealing with Save files we had faced this issue a lot. So just thought ll mention this.
                          Regards,
                          KR

                          Comment


                          • #14
                            Re: Transferring Save file

                            Thank you all. I 've got quite a handfull of information on transferring save files

                            Comment

                            Working...
                            X