FTP File Transfer Hints and Tips

   CMS File Transfers Across ASCII Hosts

Many systems used for TCP/IP activity are Unix or PC based, and do not have a file record length/format concept like VM does; files are just a "stream" of bytes, with records (lines) delimited by only a line feed character. So, when structure-sensitive CMS files (such as MODULES) are FTP'd from VM to an AIX host, for example, the CMS file structure will be lost -- unless extra measures are taken prior to, and during, the FTP process.

To avoid corruption, it's necessary to first pack a structured VM file using the CMS COPYFILE command, and then handle the file in question as a binary file until that file again resides at its final destination (presumably another VM host).

Note!
This process will work only if the file in question is simply "stored" on an intermediate host or hosts (such as a PC). If the file being transferred is manipulated or altered in some manner while it resides on an intermediate host, the file will likely become corrupted.

A Sample "Structure Sensitive" File Transfer

The information that follows presents a stylized transfer of a structure-sensitive CMS file, first from a VM host to an intermediate AIX (Unix) host, and then from this AIX host to the desired VM host. Information that is likely to vary, based on the platforms in use or due to the unique environments, is presented in italics.

Note!
Be sure to adjust the commands that follow to reflect the systems that you use, and supply any appropriate platform or application-specific values when necessary.

  1. On the VM host where the file to be transferred currently resides, copy and pack the subject file to create a RECFM F 1024 version of the file to be transferred Feel free to copy the file to a different file name/file type if necessary.

      copyfile fn ft fm  (pack olddate replace
    

  2. Transfer (FTP) the packed file to the intermediate (Unix) host. Use either (a) or (b), as appropriate, based on where the FTP is initiated:

    1. Commands for a file put from the VM host to the intermediate host:
      • ftp hostname
      • user username
      • pass password
      • mode s
      • type i
      • put fn.ft.fm aixfilename
      • quit

    2. Commands for a file get, initiated on the intermediate (Unix) host:
      • ftp hostname
      • user username
      • pass password
      • mode s
      • type i
      • get fn.ft.fm aixfilename
      • quit

  3. Transfer the "binary" file to the VM host. Use either (a) or (b), as appropriate, based on where the FTP is initiated:

    1. Commands for a file put from the intermediate (Unix) host to the VM host:
      • ftp hostname
      • user username
      • pass password
      • binary

        Note! Usually, the binary command is sufficient, so that the transfer mode is S (stream), and the transfer type is I (image).

      • site fixrecfm 1024

        Note! From some hosts, you may need to preface the above site command with the quote command, in order to bypass local command processing. This may also be necessary if the site command is not supported on the local host.

      • put aixfilename vmfn.vmft
      • quit

    2. Commands for a file get, initiated on the VM host:
      • ftp hostname
      • user username
      • pass password
      • mode s
      • type i
      • locsite fixrecfm 1024
      • get aixfilename fn.ft.fm
      • quit

      Note: The above set of commands can be somewhat reduced, as follows:

      • ftp hostname
      • user username
      • pass password
      • mode s
      • binary fixed 1024
      • get aixfilename fn.ft.fm
      • quit

  4. On the VM system where the just-transferred file resides, unpack the RECFM F 1024 file that was created. As before, copy/unpack this file to a different file name/file type if necessary.

      copyfile fn ft fm  (unpack olddate replace
    

   File Transfers Between EBCDIC Hosts

When files are transferred directly between IBM EBCDIC hosts (for example, from one VM host to another VM host, or from a VM host to a z/OS or MVS host) satisfactory results are most often achieved by specifying the following FTP subcommands prior to a put or get operation:

  • mode b
  • type e

These subcommands avoid EBCDIC to ASCII translations and cause data do be transmitted as a series of data blocks; this allows logical record boundaries to be preserved.