Transferring savefiles through FTP
If you need to transfer savefiles from one i5/OS instance to another, you have the choice between physical media, SNA (SNDNETF) and FTP.
Using FTP to transfer savefiles has a few quirks that are non-intuitive at first, and it’s more complicated if you’re transferring from one i5/OS instance to another. I often transfer savefiles from our system to customer systems, with my laptop as an intermediary.
Let’s start with the simple ones:
Downloading the savefile QGPL/TRANSFER to a PC:
C:\tmp>ftp 270.int.dataline.ch
Verbindung mit 270.int.dataline.ch wurde hergestellt.
220-QTCP at i270.int.dataline.ch.
220 Connection will close if idle more than 5 minutes.
Benutzer (270.int.dataline.ch:(none)): lukas
331 Enter password.
Kennwort:
230 LUKAS logged on.
ftp> quote site namefmt 1
250 Now using naming format "1".
ftp> cd /qsys.lib/qgpl.lib
250 "/QSYS.LIB/QGPL.LIB" is current library.
ftp> binary
200 Representation type is binary IMAGE.
ftp> get transfer.savf
200 PORT subcommand request successful.
150 Retrieving member TRANSFER in file TRANSFER in library QGPL.
226 File transfer completed successfully.
FTP: 705408 Bytes empfangen in 0.65Sekunden 1090.28KB/s
ftp> quit
221 QUIT subcommand received.
There are a few important things to notice here: QUOTE SITE NAMEFMT 1 changes the System to use the IFS naming format (you can change the default using CHGFTPA). BINARY switches to binary transfer mode, this is especially important for uploads (i5/OS refuses non-binary savf downloads).
Uploading from a PC or i5/OS instance is essentially the same, so i’ll lump these two together in the next section:
C:\tmp>ftp 270.int.dataline.ch
Verbindung mit 270.int.dataline.ch wurde hergestellt.
220-QTCP at i270.int.dataline.ch.
220 Connection will close if idle more than 5 minutes.
Benutzer (270.int.dataline.ch:(none)): lukas
331 Enter password.
Kennwort:
230 LUKAS logged on.
ftp> quote site namefmt 1
250 Now using naming format "1".
ftp> binary
200 Representation type is binary IMAGE.
ftp> cd /qsys.lib/qgpl.lib
250 "/QSYS.LIB/QGPL.LIB" is current library.
ftp> del TRANSFER.SAVF
250 File TRANSFER in library QGPL deleted.
ftp> put TRANSFER.SAVF
200 PORT subcommand request successful.
150 Sending file to member TRANSFER in file TRANSFER in library QGPL.
226 File transfer completed successfully.
FTP: 705408 Bytes gesendet in 0.69Sekunden 1026.79KB/s
ftp> quit
221 QUIT subcommand received.
Now, the special case comes into play when you’re downloading from an i5/OS instance. If you do not precreate the savefile and overwrite it, you’ll end up with a simple PF-DTA, that you can’t restore from.
CRTSAVF QGPL/TRANSFER
FTP '270.int.dataline.ch'
Es wird versucht, eine Verbindung zu Host 270.int.dataline.ch, Adresse 10.33.0.20 über Port 21 herzustellen.
220-QTCP at i270.int.dataline.ch.
220 Connection will close if idle more than 5 minutes.
> lukas
331 Enter password.
230 LUKAS logged on.
OS/400 is the remote operating system. The TCP/IP version is "V5R4M0".
250 Now using naming format "1".
257 "/" is current directory.
> namefmt 1
250 Now using naming format "1".
Server NAMEFMT ist 1.
Client NAMEFMT ist 1.
> lcd /qsys.lib/qgpl.lib
Das lokale Arbeitsverzeichnis ist /QSYS.LIB/QGPL.LIB
> cd /qsys.lib/qgpl.lib
250 "/QSYS.LIB/QGPL.LIB" is current library.
> get TRANSFER.SAVF (REPLACE
227 Entering Passive Mode (10,33,0,20,73,134).
150 Retrieving member TRANSFER in file TRANSFER in library QGPL.
226 File transfer completed successfully.
33792 Byte in 0.436 Sekunden übertragen. Übertragungsgeschwindigkeit 77.585 KB/s.
There are a few more noteworthy things in this transcription: We used “namefmt 1″ instead of “quote site namefmt 1″. This will also advise the local FTP client to change it’s naming format. We also issue a cd and an lcd command to change the FTP server and the FTP client to the correct diretory. Then, we call the get command with the special (REPLACE parameter, telling it to replace the already existing savefile (and thus preserving the SAVF attribute).
You’ll also notice that IBM still hasn’t updated their branding throughout i5/OS…

Santhosh:
Can u please let me know whether quote site namefmt 1 works on linux also. If not is there any other alternative for this
15. February, 2008, 09:42H Bowman:
Thank you for this very useful ftp information for the iSeries. Excellent and worked great.
23. July, 2008, 15:03