This article was originally published in Perspective, Volume 19, Number 3, 1995, pp. 15-25.

The countdown clock reminds users to complete the migration off the ES/9000 by June 30, 1996.
by Michael Mitchell, Ph.D.
Are you migrating from MVS to AIX? If so, you probably have many datasets on MVS that you would like to transfer to AIX. This article describes how you can use File Transfer Protocol (FTP) to transfer your datasets from MVS to AIX. We first provide general instructions describing how to use FTP, followed by example FTP sessions which show how various types of datasets can be transferred from MVS to AIX, including SAS transport files, SPSS export files, text datasets, Wylbur edit datasets, and datasets contained in a partitioned dataset (PDS).
This article assumes that you know what types of datasets you are transferring, and if any processing needs to take place to make your datasets usable on AIX. If you have any doubt about what types of datasets you are transferring, or whether your datasets can be used on AIX, see the article in this issue "How to Identify MVS Datasets for Migration" or schedule an appointment with an OAC Consultant.
Figure 1 illustrates a general four-step procedure for using FTP to transfer your datasets from MVS to AIX. Step 1 is to enter Unix commands to prepare for the transfer, and start an FTP session from the local host (AIX) to the remote host (MVS). In step 2, FTP subcommands are entered to prepare for the file transfer, and then in step 3, FTP subcommands are entered to transfer your datasets. As the dashed line in Figure 1 shows, steps 2 and 3 can be repeated to transfer different types of datasets during one FTP session. When you are finished transferring datasets, you can then quit FTP (step 4). These steps are described in more detail below.
We recommend that you invoke your FTP session from your AIX login ID (rather than from your MVS account). So, the first step is to login to the SP2/cluster. This will be the local host for the FTP session.
The "mkdir" command can be used to make directories in which your transferred files will be stored. You cannot make directories while in FTP. (Type "man mkdir" for more information about the "mkdir" command.)
The "cd" command selects the current working directory. By default, FTP places transferred files into the current working directory. (You can type "man cd" for more information about the "cd" command.)
Open an FTP connection to MVS with the following command. This will establish MVS as the remote host for your FTP session.
ftp mvs.oac.ucla.edu
At the name and password prompts enter your MVS userid and password, as shown below.
Name (mvs.oac.ucla.edu:userid): aaaaiii
send password please.
Password:
If the connection is opened successfully, you will see the message
AAAAIII is logged on
(where AAAAIII is your MVS userid). You can now enter FTP commands at the ftp> prompt.
We describe four types of FTP subcommands you can use to prepare for the transfer. These commands allow you to view datasets on the remote host (MVS), select a PDS on the remote host from which datasets will be transferred, select the target directory on the local host (AIX) in which files will be placed, and set file transfer options, which affect the file transfer process. These commands, which can be issued in any order, are described below.
You probably have not memorized the names of all of your datasets on your MVS catalog. FTP provides the "dir" subcommand for viewing the datasets on your MVS catalog (i.e., datasets on the remote host). Examples of the "dir" subcommand are shown below.
Example 1: dir shows a listing of all datasets on the remote host (i.e., datasets in your MVS catalog).
Example 2: dir xpt.election shows if you have a dataset called XPT.ELECTION on MVS.
Example 3: dir xpt.* shows all datasets in your MVS catalog that begin with XPT.
Example 4: dir prog(*) shows all datasets contained in your PDS called PROG.
Example 5. dir prog(j*) shows all datasets in your PDS called PROG which begin with the letter J.
You can use the FTP subcommand "cd" to select a PDS from which datasets will be transferred. If you want to select a PDS as the source for your transfer, type:
cd 'aaaaiii.<pdsname>'
where aaaaiii is your MVS userid and pdsname is the name of the PDS you would like to select. You must include the single quotes when typing this command. If you want to return to your main catalog, type:
cd 'aaaaiii'
and you will be returned to your main catalog.
Example 1: cd 'aaaaiii.prog' selects your PDS PROG.
Example 2: cd 'aaaaiii' selects your main catalog. Use this to return to your main catalog after selecting a PDS.
By default, FTP will transfer files to the current working directory on the local host (AIX). FTP provides the "lcd" (local change directory) subcommand for changing the current working directory on the local host (AIX). Typing just "lcd" sets your home directory as the current working directory on the local host (AIX). Examples of the "lcd" command are shown below.
Example 1: lcd ~ selects your home directory on the local host (AIX).
Example 2: lcd ~/spss selects the spss directory under your home directory on AIX. This assumes that the spss directory exists.
Example 3: lcd selects your home directory on AIX, where datasets would be placed if you transferred them from MVS to AIX.
FTP provides numerous file transfer options which affect the file transfer process. We describe three common options which need to be carefully set, file transfer mode, case mapping, and prompting.
There are two file transfer modes, binary and ascii. Binary transfer mode (sometimes called image mode) means that files will be transferred bit by bit as an exact image. By contrast, an ascii mode transfer will translate each character from ebcidic (the MVS character set) to ascii (the AIX character set).
Binary transfer mode is selected by typing "binary" and should be used when transferring SAS transport files, Wylbur edit datasets, and any other datasets which should be transferred as an exact image. If you transfer Wylbur edit datasets, use the "wylcvt" command on AIX to convert them into a format usable on AIX (see Step 4).
The ascii transfer mode is selected by typing "ascii" and should be used when transferring text datasets (e.g. raw data, SAS programs, and SPSS programs which have been stored as unnumbered files), SPSS export files, and any other datasets in which ebcidic characters should be converted to ascii characters.
The "case" subcommand toggles case mapping (the translation of upper case MVS dataset names into lower case on AIX). When you start FTP, case mapping is off (file names will remain in upper case). Type "case" and case mapping will be turned on (file names will be converted to lower case). If you type "case" again, case mapping will be turned off. The "case" subcommand is useful when transferring multiple datasets with wildcards, or when the dataset name on the "get" command is typed in upper case. We recommend always using the case command to ensure that your AIX file names are in lower case.
The "prompt" subcommand toggles whether FTP will ask for permission before transferring each file when you use the "mget" subcommand to transfer multiple files. By default, the prompt subcommand is on (you will be prompted before each file is transferred). You can type "prompt" and groups of files will be transferred without asking for your permission. Typing "prompt" again would restore prompting.
There are two FTP subcommands for transferring files, "get" and "mget". "Get" is used to transfer a single file, and "mget" is used to transfer multiple files.
The syntax of the "get" subcommand is:
get <mvs dsname> <aix filename>
where mvs dsname refers to the name of the MVS dataset to transfer (omitting your userid) and aix filename is optional, allowing you to supply the name the file will be given when it is written to AIX. If you omit aix filename the file will be given the same name as it had on MVS (omitting your userid).
Example 1: get xpt.election transfers XPT.ELECTION from MVS as xpt.election on AIX.
Example 2: get election.disk.mvs.pgm election.aix.pgm transfers ELECTION.DISK.MVS.PGM from MVS as election.aix.pgm on AIX.
Example 3: get programs(test) programs.test transfers PROGRAMS(TEST) (the member TEST of the PDS PROGRAMS) from MVS as programs.test on AIX.
The "mget" subcommand can be used with the wildcard character (*) to transfer multiple files. Its syntax is:
mget <mvs dsname with wildcard>
Example 1: mget xpt.* transfers all datasets which begin with XPT.
Example 2: mget *.sas transfers all datasets that look like *.SAS. Note that this would only include two level datasets that end with SAS (e.g. X.SAS) but not three level datasets names that end in SAS (e.g. not X.Y.SAS).
Example 3: cd 'aaaaiii.prog' mget * transfers all members of the PDS called PROG.
To end your FTP session, type "quit".
If you have transferred Wylbur edit datasets, be sure to run the command "wylcvt" on AIX to convert them into regular text files. You can run "wylcvt" by typing:
wylcvt <filename>
The filename can contain wildcard characters (e.g. ? or *).
Figures 2 through 7 contain example FTP sessions which show how FTP can be used to transfer a variety of different datasets, including SAS transport files, SPSS export files, text datasets, text datasets in a PDS, Wylbur edit datasets, and Wylbur edit datasets in a PDS. In each Figure, the AIX prompt is shown as a dollar sign ($); the prompt you have for your AIX session may be different. Text which appears in bold italics is entered by the user; all other text shows messages given by the computer. The essential parts of each example are described below.
Figure 2 shows how a SAS transport file called XPT.ELECTION was transferred from MVS to AIX. Note that the SAS transport file was transferred using binary transfer mode. The binary mode must be used when transferring SAS transport files. Refer to the article "Moving SAS Data Libraries from MVS to AIX" for instructions on creating SAS transport files.
Figure 3 shows how an SPSS export file called SPSSXPT.ELECTION was transferred from MVS to AIX. It is important to note that SPSS was transferred using ascii transfer mode. The ascii mode must be used when transferring SPSS export files. Refer to the article "Moving SPSS System Files from MVS to AIX" for instructions on creating SPSS export files.
Figure 4 illustrates how a text dataset (e.g. raw data, SAS programs, or SPSS programs in card image format) can be transferred from MVS to AIX. Note that text datasets must be transferred in ascii mode, as shown in Figure 4.
Figure 5 illustrates how to send a Wylbur edit dataset called ELECTION.WYLBUR from MVS to AIX. Please note two differences between sending a text dataset (Figure 4) and sending a Wylbur edit dataset (Figure 5). First, the Wylbur edit dataset must be sent using binary transfer mode. Second, the "wylcvt" command on AIX is used to convert the dataset from Wylbur format to a regular text file which can be read and edited on AIX.
Figure 6 shows how text datasets contained in a PDS called PROG can be transferred from MVS to AIX. It is assumed that this PDS was made in card image format (see "How to Identify MVS Datasets for Migration" in this issue for more information on card image datasets). Before FTP is started, the "mkdir" command is used to create a directory called PROG for holding the contents of the PROG PDS. Then, the "cd" command is used to select PROG as the current working directory, the directory in which transferred files will be placed.
Once FTP is started, the "prompt" command is given to shut off prompting before transferring files. The "ascii" command is used because the datasets to be transferred are text datasets. The "cd" command is used to select the PROG PDS. Then, the "mget *" command is used to transfer all members of the PDS. It is also possible to use the get subcommand to transfer selective members of the PDS.
Figure 7 shows how Wylbur edit datasets contained in a PDS called PROGWYL can be transferred from MVS to AIX. The procedure for transferring Wylbur edit datasets (Figure 7) is nearly identical to transferring text datasets (Figure 6), except for two key differences. First, Wylbur edit files must be transferred using binary transfer mode. Second, the "wylcvt" command on AIX is used to convert the datasets from Wylbur format to a format usable on AIX.
These directions assume that you know what types of datasets you are transferring, and that you know that the dataset will be usable on AIX, or can be made usable on AIX. If you are unsure of any of these points, see the article in this issue called "How to Identify MVS Datasets for Migration."
General Procedure for using FTP to transfer datasets from MVS to AIX
How to FTP a SAS transport file from MVS to AIX
How to FTP an SPSS export file from MVS to AIX
How to FTP a text dataset from MVS to AIX
How to FTP a Wylbur edit dataset from MVS to AIX
How to FTP text datasets in a PDS from MVS to AIX
How to FtP Wylbur edit datasets in a PDS from MVS to AIX
Michael Mitchell, Ph.D., is an OAC Statistical Consultant who provides guidance to users in the implementation of statistical methodologies and the analysis of large and complex databases.
21 Jul 95; Rev. 19 Dec 95