By Dr. Karl Ho, Research and Statistical Support Services Manager
Data Capability: Transporting data from the Mainframe
In the 2001 November issue of Benchmarks Online, Dr. Baczewski pronounced the shutdown of the academic mainframe in 2003 (proposed, read original). It is never too early to start packing up. In this article, I introduce the method of moving SAS data to local platforms. There are many ways to do that but the following method is relatively easier to implement and safe for data.
1. Converting to transport file
Since transporting data involves using file transfer programs, it is better to convert the SAS system files into a portable format so the transportation process will not contaminate the data. In SAS the format is called transport file. SAS has a specialized engine that handles the transport file. To convert to transport file, the PROC COPY procedure is used:
LIBNAME TRANS XPORT 'FILENAME';
This short program creates a transport file using the XPORT engine in the LIBNAME statement. Note that this LIBNAME statement is pointing to a file instead of a directory as we usually do.
The PROC COPY procedure copies the file WORK.COUNTRY to the output transport file. You can use any FTP program to transfer the file to other platforms including PC and UNIX. Note that binary mode is used.
The following is a complete MVS program that converts the SAS system file into transport file:
This program converts a SAS system file located on MVS system disk (ACAD03) into a transport file on the same disk. The IEFBR14 procedure cleans up any file previously created in the same name. Note that the boldfaced DCB (Data Control Block) specification, which fixes the LRECL (Logical Record Length) to 80, is the key for the file conversion. The new transport file MUST BE a sequential file in 80 columns.
2. Downloading file to CMS
Now, the transport file is on MVS disk. Before downloading to PC, we need to get the file to CMS. The IEBGENER program does this job:
This program downloads the transport file from the MVS system disk ACAD03 to the CMS environment and the PUNCH output (the SAS transport file) will be routed to the user's READER LIST. Preparing for a large data set, this program specifies CLASS=N and a large number for the JOBPARM parameter. It is recommended to create a temporary disk before receiving the file to CMS. To create a temporary disk in CMS, type: tempdisk at the Ready mode. Specify the number of cylinders for temporary storage. By default, the temporary 193 disk will be created as the E disk. Copy the file from the READERLIST to E disk by receiving the transport file into TEST TRANSPRT E1. At the command column, type:
3. Downloading the transport file to local host (UNIX or PC)
Most of the TN3270 programs (e.g. Hummingbird's HostExplorer) has built-in file transfer functions. Remember to transfer the file using binary format:
4. Reading the SAS transport file in SAS for Windows
Now the file is at bay and you can read it in SAS. The following program does the trick:
libname trans xport
'c:\temp\test.transport'; /* transport file */
This process may be a bit tedious but it works well with all my data. And you will find the time well spent. Regardless, my suggestion is what my mom always tells me: DO NOT WAIT TILL THE LAST MINUTE!
Have a merry Christmas and happy new year.
SAS Institute Inc., SAS Companion for the MVS Environment, Version 6, Second Edition, Cary, NC: SAS Institute Inc., 1996. 503 pp.
Research and Statistical Support (RSS). FAQ: How to convert a SAS data set from the mainframe to SAS for Windows? (http://www.unt.edu/rss/faq/sas0001.htm)