IBM Support

Using FTP to Move a File in SAVF Format from a PC to a Library

Troubleshooting


Problem

This document contains step-by-step directions for using FTP to move a file in save file format from a PC to the IBM System i system.

Resolving The Problem

The CS2 queue maintains an FTP site that contains sample utilities that users can download and change, use, and so on. These utilities are not supported (they are offered only "as is"). The FTP site can be accessed at:

ftp://public.dhe.ibm.com/services/us/igsc/cs2/ApiSamples/

Many of the utilities on the FTP site are in save file (SAVF) format and must be downloaded to the user PC, transferred to the to the operating system using FTP, and then restored to the user's system.

The purpose of this document is to make users aware of some special circumstances that may be encountered when a user is transferring the save files to the i5/OS.

The i5/OS Change FTP Attributes (CHGFTPA) command is used to configure the way that FTP works on the operating system. According to the help text for CHGFTPA:

'The Change FTP attributes (CHGFTPA) command changes the configuration for the File Transfer Protocol (FTP) servers. The FTP attributes can be changed while the FTP servers are active. The attributes that were changed take affect the next time an FTP server connection is made. All existing connections are not changed but keep the same attributes they had when the connection was established.'

There are parameters that, when used with the CHGFTPA command, can cause some puzzling situations when trying to transfer save files to the operating system. Following are samples of specific settings and ways to 'handle' them.

    • - Example 1: CHGFTPA NAMEFMT(*LIB) CURLIB(*CURLIB) LISTFMT(*DFT)



      Use IFSTOOL.SAVF as the name of the SAVF being transferred. IFSTOOL.SAVF is stored in the root directory (C:\) on the PC hard drive.

      On the i5/OS, the CHGFTPA command shows the following settings:

      Initial name format NAMEFMT. . . . . . *LIB
      Initial directory CURDIR . . . . . . . *CURLIB
      Initial list format LISTFMT. . . . . . *DFT

      When using this configuration, FTP the file from the PC to the operating system save file do the following:

      1.To create the save file to transfer the PC file to, from an operating system command line type the following:

      CRTSAVF FILE(YOURLIB/IFSTOOL)

      where YOURLIB is an actual i5/OS user library. Press the Enter key. Name the save file the same as the PC file but without the extension. Because the PC file is IFSTOOL.SAVF name the SAVF IFSTOOL.
      2.Type the following on the PC command (DOS) prompt (C:\):

      ftp xxx.xxx.xxx.xxx

      where xxx.xxx.xxx.xxx is the IP address of the System i™ system. Press the Enter key.
      3.Type your operating system user ID when prompted.
      4..Type your operating system password when prompted.
      5.Type the following:

      cd yourlib

      where yourlib is the library name of the library you created the save file in. Press the Enter key.
      6.Type the following (for binary transfer):

      bin

      Press the Enter key.
      7.To transfers the PC file into the save file you created on the iSeries family system, type the following:

      put C:\IFSTOOL.SAVF

      Press the Enter key.
      8.To view the contents of the save file, from the operating system command line, type the following:

      DSPSAVF FILE(YOURLIB/IFSTOOL)

      Press the Enter key.


      • - Example 2: CHGFTPA NAMEFMT(*PATH) CURLIB(*HOMEDIR) LISTFMT(*DFT)



        Uses IFSTOOL.SAVF as the name of the SAVF being transferred. IFSTOOL.SAVF is stored in the root directory (C:\) on the PC hard drive.

        On the System i system, the CHGFTPA command shows the following settings:

        Initial name format NAMEFMT. . . . . . *PATH
        Initial directory CURDIR . . . . . . . *HOMEDIR
        Initial list format LISTFMT. . . . . . *DFT

        One way to handle this situation is to FTP the PC file to a directory on the Integrated File System. Then, use the CPYFRMSTMF command to copy the file from the Integrated File System directory into an operating system save file in the QSYS.LIB file system. When using this option, to transfer the file from the PC to the System i system do the following:

        1.To create the save file to transfer the PC file to, on the operating system command line, type the following:

        CRTSAVF FILE(YOURLIB/IFSTOOL)

        where YOURLIB is the name of an actual iSeries family system library. Name the save file the same as the PC file but without the extension. Because the PC file is IFSTOOL.SAVF, name the save file IFSTOOL.
        2.To rename the PC file so that it has an extension of .SAV, type the following from the PC command (DOS) prompt (C:\):

        REN IFSTOOL.SAVF IFSTOOL.SAV

        Press the Enter key.
        3.Type the following on the PC command (DOS) prompt (C:\):

        ftp xxx.xxx.xxx.xxx

        where xxx.xxx.xxx.xxx is the IP address of the iSeries family system.
        4.Type your operating system user ID when prompted.
        5.Type your operating system password when prompted.
        6.Type the following:

        cd /DIRNAME

        where DIRNAME is the name of the Integrated File System directory you want to transfer the PC file in.
        7.For binary transfer, type the following:

        bin

        Press the Enter key.
        8.put C:\IFSTOOL.SAV
        This transfers the PC file into the Integrated File System directory.
        9.To transfer the PC file into the save file you created on the operating system, on the operating system command line, type the following:

        CPYFRMSTMF FROMSTMF('/DIRNAME/IFSTOOL.SAV') +
        TOMBR('/QSYS.LIB/YOURLIB.LIB/IFSTOOL.FILE') +
        MBROPT(*REPLACE)

        Press the Enter key.
        10.To view the contents of the save file, on the operating system command line, type the following:

        DSPSAVF FILE(YOURLIB/IFSTOOL)

        Press the Enter key.


        • - Example 3: CHGFTPA NAMEFMT(*PATH) CURLIB(*HOMEDIR) LISTFMT(*DFT)



          This example is an alternate way of handling the same situation described in the previous example.

          Use IFSTOOL.SAVF as the name of the save file being transferred. IFSTOOL.SAVF is stored in the root directory (C:\) on the PC hard drive.

          On the iSeries family system, the CHGFTPA command shows the following settings:

          Initial name format NAMEFMT. . . . . . *PATH
          Initial directory CURDIR . . . . . . . *HOMEDIR
          Initial list format LISTFMT. . . . . . *DFT

          In this example, the same steps are used as in Example 1 except the naming format is changed dynamically.

          1.To create the save file to transfer the PC file to, from an operating system command line, type the following:

          CRTSAVF FILE(YOURLIB/IFSTOOL)

          where YOURLIB is an actual operating system user library. Press the Enter key. Name the save file the same as the PC file but without the extension. Because the PC file is IFSTOOL.SAVF name the SAVF IFSTOOL.
          2.Type the following on the PC command (DOS) prompt (C:\):

          ftp xxx.xxx.xxx.xxx

          where xxx.xxx.xxx.xxx is the IP address of the System i system. Press the Enter key.
          3.Type your operating system user ID when prompted.
          4.Type your operating system password when prompted.
          5.To go in the QSYS.LIB file system, type the following:

          Note: If this step is not completed, the command in the next step fails.

          cd /QSYS.LIB

          Press the Enter key.
          6.To change to the format that allows access to operating system libraries and files, type the following:

          quote site namefmt 0

          Press the Enter key.
          7.Type the following:

          cd YOURLIB

          where YOURLIB is the library name where you earlier created the save file. Press the Enter key.
          8.Type the following (for binary transfer):

          bin

          Press the Enter key.
          9.To transfers the PC file into the save file you created on the System i system, type the following:

          put C:\IFSTOOL.SAVF

          Press the Enter key.
          10.To view the contents of the save file, from the operating system command line type the following:

          DSPSAVF FILE(YOURLIB/IFSTOOL)

          Press the Enter key.



        Once the PC file has been transferred into an operating system save file, it can be restored using the RSTOBJ command.

        Note: If the save file is not created on i5/OS before performing the transfer with a library name format, the transfer will appear to complete satisfactorily. However, FTP will create a physical file rather than a save file, and you will not be able to restore the objects or recover them from this physical file. You can create the save file from within FTP by running the following FTP subcommand: quote rcmd crtsavf yourlib/ifstool

        Additional information on NAMEFMT and other FTP commands can be found in the OS/400 TCP/IP Configuration and Reference V4R4 manual,SC41-5420-03.

        [{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Access for Windows","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

        Historical Number

        23582433

        Document Information

        Modified date:
        18 December 2019

        UID

        nas8N1017325