FTP'ing a save file to an iSeries - copying a physical file to a save file

Date:3 March 2003
Product/Release:OS/400
Abstract:FTP'ing a save file to an iSeries and forgetting to create the save file first - steps to copy a physical file to a save file
Submitted By:LANSA Technical Support

If you have FTP'ed a save file to an iSeries but do not create the save file on our system first, a physical file is automatically created that contains save file data. Instead of deleting the physical file and redoing the process correctly, there is a way to copy that physical file to a save file.

  • Create the save file that should have been created in the first place. You'll probably have to rename the physical file first, since it probably has the name your save file should have: 
    rnmobj mylib/mysavf *file mypf
    crtsavf mylib/mysavf
  • Start your iSeries FTP client, specifying the loopback address of 127.0.0.1. In other words, the FTP client is communicating with the FTP server on the same machine:
    ftp '127.0.0.1'
  • After logging into FTP, change to binary mode:
    bin
  • Use the Put command to copy the physical file to the save file:
    put mylib/mypf.savf mylib/mysavf
  • Notice that the physical file's member is named SAVF. This may not be true under all releases, but that's the way it works in V5R1.
  • Tip: you don't have to create the save file in advance if you use name format 1. So, you can issue commands like the following when FTP'ing from a PC to an iSeries:
    quote site namefmt 1
    put /mydir/mysavf.savf /qsys.lib/mylib.lib/mysavf.savf

    This transfers file MYSAVF.SAVF, in directory MYDIR of the PC, to save file MYSAVF in library MYLIB.