How to use command-line FTP

The term "FTP" refers to "file transfer protocol". FTP programs are used to transfer files between computers. The two computers do not have to be using the same operating system or file system.

These notes refer specifically to transferring files between a personal computer at NIU and the Z/OS system at Marist college. The same principles would apply to other transfers.

These notes refer to using the command-line version of FTP. There are also FTP programs which work under graphical user interfaces such as Windows.

There are many more FTP commands than the few shown here. You can read about them in the Windows help system or UNIX manual pages.


Before attempting to ftp a program to Marist, make sure you can access your Marist account with a standard 3270 terminal program such as Vista TN3270.

On a Windows system, run command.com to open a dos command line window. On a Linux or MacOs system, start a terminal session.

Change to the directory (also known as a folder) in which you want to keep your mvs programs and retrieved output.

At the prompt, enter :

ftp zos.kctr.marist.edu

When ftp prompts for your user id and password, enter the same kc_id and password as you do with Vista TN3270 or your preferred 3270 terminal emulator.


Suppose you simply want to transfer programs between your personal computer and your account at Marist. Then:

  • Use put to copy a file from your personal computer to Marist:
    put file_to_transfer
  • Use get to copy a file from Marist to your persomal computer:
    get file_to_transfer
  • Use ls or dir to list files in your account at Marist:
    ls
  • Use del to delete name file from the Marist system.
    del file_name 


    Suppose you want to use ftp to submit a local file to be executed by the Z/OS system at Marist, you need to run an additional command:

    quote site filetype=jes

    This command tells Marist's ftp server to communicate any file handling commands to the job entry spooler (that is "jes") rather than applying them to your working dataset storage.

    Now put will now transfer the program file to JES which will run the program if it was written correctly:

    put my_prog.jcl

    Use ls or dir to list any jobs initiated by you and currently being held in the JESl output spoooler:

    ls

    Use get to fetch a copy of the currently held jobs in the JES output hold queue:

    get job####.x

    The x is generally required and indicates all of the job's parts are to be retrieved.

    It may take a short time for the mainframe system to transfer all of the job to the output hold queue, so give the system about 20 seconds before attempting to fetch the results.

    To delete an old job from the output hold queue, use del:

    del job####

    If you find a submitted job does not appear in the hold queue, or it appears and then immediately disappears, check the first line, that is, the JOB line, on your program for errors.

    If you find you cannot retrieve a job held in the output queue, again check your job line. It this case, make sure the job id, your k_id is correct and has the required pad character.


    To set the ftp session back to transfers between your personal computer and your stored dataset area, use:

    quote site filetype=seq


    To end the session, use quit:

    quit

    It should be possible to submit and fetch jobs with a graphical version of ftp, but you will have to find out how to provide the quote site commands.