Previous Page | Next Page

Examples of Moving SAS Files

Example: z/OS JCL Batch to UNIX File Transport


Overview of the z/OS JCL Batch Program

Although presented in four parts, the following program is designed as a single program. The following processes are performed:

  1. PROC COPY is used to create a transport file on the z/OS source computer.

  2. The transport file is transferred over the network to the UNIX target computer.

  3. The accuracy of the transport file is verified.

  4. PROC COPY is used to restore the transport file to the z/OS source computer.

Embedded comments document the program.


Using PROC COPY to Create a Transport File

Creating Data Sets and Transport Files shows the first part of the program that creates three data sets in z/OS format and translates them to transport format. For details in the SAS log that pertains to the execution of this program part, see Recording the Creation of Data Sets and Transport Files in the SAS Log.

Creating Data Sets and Transport Files

//XPORTTST JOB job-card-information
//*----------------------------------------------
//* Run SAS step that creates a transport library
//* for the three SAS test data sets.

//*----------------------------------------------
//SASOUT    EXEC SAS
//*----------------------------------------------
//* Allocate the SAS XPORTOUT library.
//* The XPORTOUT library should have the
//* following data set information:
//* Record format: FB
//* Record length: 80
//* Block size:    8000
//* Organization:  PS
//*----------------------------------------------

//XPORTOUT DD DSN=userid.XPORTOUT.DAT, DISP=(NEW,CATLG,DELETE),
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),
//            SPACE=(TRK,(1,1))
//SYSIN    DD *
 /*------------------------------------------*/
 /* Assign the SAS test xport library        */
 /*------------------------------------------*/
libname xportout xport;

 /*------------------------------------------*/
 /* Creates data set GRADES which contains   */
 /* numeric and character data.              */
 /*------------------------------------------*/
data grades;
   input student $ test1 test2 final;
   datalines;
Fred  66 80 70
Wilma 97 91 98
;

 /*-----------------------------------*/
 /* Creates data set SIMPLE which     */
 /* contains character data only.     */
 /*-----------------------------------*/
data simple;
   x='dog';
   y='cat';
   z='fish';
run;

 /*------------------------------------*/
 /* Creates data set NUMBERS which     */
 /* contains numeric data only.        */
 /*------------------------------------*/
data numbers;
  do i=1 to 10;
     output;
  end;
run;
 /*------------------------------------*/
 /* Copy the three test data sets to   */
 /* the XPORT library.                 */
 /*------------------------------------*/
proc copy in=work out=xportout;
run;
/*


Transferring the Transport File across the Network

This example shows the generation of the FTP command file and the transfer of the transport file over the network to the target computer. For details in the SAS log that pertains to the execution of this part of the program, see Recording the Transfer of the Transport File to the Target Computer in the SAS Log.

Using FTP to Transfer Transport Files

//*------------------------------------------------- 
//* Generate FTP command file for sending XPORTOUT 
//* test library to the target computer. 
//*------------------------------------------------- 
//FTPCMDO  EXEC PGM=IEBGENER,COND=EVEN 
//SYSPRINT DD SYSOUT=* 
//SYSIN    DD DUMMY 
//SYSUT2   DD DSN=userid.FTP.OUT, 
//            UNIT=DISK,DISP=(NEW,CATLG), 
//            SPACE=(TRK,(1,1)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160) 
//*-------------------------------------------------
//* Ensure that the FTP commands specify a BINARY
//* mode transfer.
//*-------------------------------------------------
//SYSUT1   DD *
userid password
cd mydir
binary
put 'userid.xportout.dat' xportout.dat
quit
/*
//*----------------------------------------------
//* FTP library XPORTOUT to the target computer.
//*----------------------------------------------
//FTPXEQO EXEC PGM=IKJEFT01,REGION=2048K,DYNAMNBR=50,COND=EVEN
//SYSPRINT DD SYSOUT=*
//SYSTSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ALLOC FI(input) DA('userid.FTP.OUT') SHR
FTP target-host (EXIT
/*


Verifying the Accuracy of the Transport File

This example shows the verification of the transport file by transferring it from the UNIX target computer to the z/OS source computer in native format. A successful translation from transport format to native z/OS format verifies the accuracy of the transport file. For details in the SAS log that pertain to the execution of this part of the program, see Recording the Verification of the Transport File in the SAS Log.

Verifying Transport Files

//*-------------------------------------------------
//* The following steps retrieve the XPORTOUT library
//* from the target computer and read the three test
//* data sets back into the WORK library.
//*-------------------------------------------------
//* Generates the FTP command file for getting
//* the test library XPORTOUT from the target computer.
//*-------------------------------------------------
//FTPCMDI  EXEC PGM=IEBGENER,COND=EVEN
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT2   DD DSN=userid.FTP.IN,
//            UNIT=DISK,DISP=(NEW,CATLG),
//            SPACE=(TRK,(1,1)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)
//*-------------------------------------------------
//* The FTP commands specify a BINARY mode
//* transfer.  Uses the LOCSITE command to define
//* the correct XPORT library data set information.
//*-------------------------------------------------
//SYSUT1   DD *
userid password
cd mydir
locsite recfm=fb blocksize=8000 lrecl=80
binary
get xportout.dat 'userid.xportin.dat'
quit
/*
//*----------------------------------------------
//* Connects to the target computer and retrieves
//* the library XPORTOUT.
//*----------------------------------------------
//FTPXEQI  EXEC PGM=IKJEFT01,REGION=2048K,DYNAMNBR=50,COND=EVEN
//SYSPRINT DD SYSOUT=*
//SYSTSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ALLOC FI(input) DA('userid.FTP.IN') SHR
FTP target-host (EXIT
/*


Using PROC COPY to Restore the Transport File

This example restores the transport file to native format on the z/OS source computer. For details in the SAS log that pertains to the execution of this part of the program, see Recording the Restoration of the Transport File to the Source Computer in the SAS Log.

Restoring the Transport File to Native Format

//*----------------------------------------------
//* Runs SAS step that reads the transport library
//* and writes the three SAS test data sets to
//* library WORK.

//*----------------------------------------------
//SASIN     EXEC SAS
//XPORTIN   DD DSN=userid.XPORTIN.DAT,DISP=SHR
//SYSIN    DD *
 /*----------------------------------------------*/
 /* Assigns the SAS test library XPORTIN.        */
 /*----------------------------------------------*/
libname xportin xport;

 /*----------------------------------------------*/
 /* Reads the transport file and writes the test */
 /* data sets to library WORK.                   */
 /*----------------------------------------------*/

proc copy in=xportin out=work;
run;
/*


Recording the Creation of Data Sets and Transport Files in the SAS Log

This SAS log shows the creation of the data sets and corresponding transport files.

Viewing the SAS Log at the z/OS Source Computer (Part 1 of 4)

                       The SAS System
                       11:03 Monday, October 26, 1999

 NOTE: Copyright (c) 1999 by SAS Institute Inc.,
  Cary, NC, USA.
 NOTE: SAS (r) Proprietary Software Version 6.09.0460P0304986
        Licensed to SAS INSTITUTE INC., Site 0000000001.

 NOTE: Running on IBM Model 9672,
                  IBM Model 9672,
                  IBM Model 9672.

 NOTE: No options specified.

 /*----------------------------------------------*/
 /* Assigns the SAS test library XPORTOUT.       */
 /*----------------------------------------------*/
 libname xportout xport;
 NOTE: Libref XPORTOUT was successfully assigned
   as follows:
       Engine:        XPORT
       Physical Name: JOE.XPORTOUT.DAT

 /*-----------------------------------------------*/
 /* Creates data set GRADES which contains        */
 /* numeric and character data.                   */
 /*-----------------------------------------------*/
 data grades;
    input student $ test1 test2 final;
    datalines;

 NOTE: The data set WORK.GRADES has 2 observations
   and 4 variables.

 /*------------------------------------*/
 /* Creates data set SIMPLE which      */
 /* contains character data only.      */
 /*------------------------------------*/
 data simple;
    x='dog';
    y='cat';
    z='fish';
 run;

 NOTE: The data set WORK.SIMPLE has
  1 observations and 3 variables.

 /*------------------------------------*/
 /* Creates data set NUMBERS which     */
 /* contains numeric data only.        */
 /*------------------------------------*/
 data numbers;
    do i=1 to 10;
    output;
    end;
 run;
 NOTE: The data set WORK.NUMBERS has
  10 observations and 1 variables.
 /*------------------------------------*/
 /* Copies the three test data sets to */
 /* the XPORTOUT library.              */
 /*------------------------------------*/
 proc copy in=work out=xportout;
 run;

 NOTE: Copying WORK.GRADES to XPORTOUT.GRADES
  (MEMTYPE=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines.
      System Option for BUFSIZE was used.
 NOTE: The data set XPORTOUT.GRADES has
  2 observations and 4 variables.
 NOTE: Copying WORK.NUMBERS to XPORTOUT.NUMBERS
 (MEMTYPE=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines.
      System Option for BUFSIZE was used.
 NOTE: The data set XPORTOUT.NUMBERS has
  10 observations and 1 variables.
 NOTE: Copying WORK.SIMPLE to XPORTOUT.SIMPLE
 (MEMTYPE=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines.
      System Option for BUFSIZE was used.
 NOTE: The data set XPORTOUT.SIMPLE has 1 observations and 3 variables.

Note:   The notes about the SAS system option BUFSIZE do not indicate an error condition. BUFSIZE specifies the permanent buffer size for an output data set, which can be adjusted to improve system performance. The system value that is assigned to the BUFSIZE option is used because the XPORT engine does not support the BUFSIZE= option. See your operating environment companion documentation for details.  [cautionend]


Recording the Transfer of the Transport File to the Target Computer in the SAS Log

This SAS log shows the transfer of the transport file to the target computer.

Viewing the SAS Log at the z/OS Source Computer (Part 2 of 4)

EZA1450I MVS TCP/IP FTP V3R2
EZA1772I FTP: EXIT has been set.
EZA1736I conn MYHOST.MYCOMPANY.COM
EZA1554I Connecting to MYHOST.MYCOMPANY.COM
  10.26.11.235, port 21
220 myhost FTP server (Version 4.162 Tue Nov 1 10:50:37 PST 1988)
  ready.
EZA1459I USER (identify yourself to the host):
EZA1701I >>>USER joe
331 Password required for joe.
EZA1701I >>>PASS ********
230 User joe logged in.
EZA1460I Command:
EZA1736I cd joe
EZA1701I >>>CWD joe
250 CWD command successful.
EZA1460I Command:
EZA1736I binary
EZA1701I >>>TYPE i
200 Type set to I.
EZA1460I Command:
EZA1736I put 'joe.xportout.dat'
  xportout.dat
EZA1701I >>>SITE VARrecfm Lrecl=80
  Recfm=FB BLKSIZE=8000
500 'SITE VARrecfm Lrecl=80 Recfm=FB
  BLKSIZE=8000': command not understood
EZA1701I >>>PORT 10,253,1,2,33,182
200 PORT command.
EZA1701I >>>STOR xportout.dat
150 Opening BINARY mode data connection for
  xportout.dat.
226 Transfer complete.
EZA1460I Command:
EZA1736I quit
EZA1701I >>>QUIT


Recording the Verification of the Transport File in the SAS Log

This SAS log shows the portion of the program that verifies the accuracy of the transport files that were transferred.

Viewing the SAS Log at the z/OS Source Computer (Part 3 of 4)

EZA1450I MVS TCP/IP FTP V3R2
EZA1772I FTP: EXIT has been set.
EZA1736I conn MYHOST.MYCOMPANY.COM
EZA1554I Connecting to MYHOST.MYCOMPANY.COM
   10.26.11.235, port 21
220 myhost FTP server (Version 4.162 Tue Nov 1 10:50:37 PST 1988)
   ready.
EZA1459I USER (identify yourself to the host):
EZA1701I >>>USER joe
331 Password required for joe.
EZA1701I >>>PASS ********
230 User joe logged in.
EZA1460I Command:
EZA1736I cd joe
EZA1701I >>>CWD joe
250 CWD command successful.
EZA1460I Command:
EZA1736I locsite recfm=fb blocksize=8000 lrecl=80
EZA1460I Command:
EZA1736I binary
EZA1701I >>>TYPE i
200 Type set to I.
EZA1460I Command:
EZA1736I get xportout.dat 'joe.xportin.dat'
EZA1701I >>>PORT 10,253,1,2,33,184
200 PORT command
EZA1701I >>>RETR xportout.dat
150 Opening BINARY mode data connection for
  xportout.dat(3120 bytes).
226 Transfer complete.
EZA1617I 3120 bytes transferred in 0.198 seconds. Transfer rate
  9.12 Kbytes/sec.
EZA1460I Command:
EZA1736I quit
EZA1701I >>>QUIT


Recording the Restoration of the Transport File to the Source Computer in the SAS Log

This SAS log shows the part of the program that copies the transport file to native format on the z/OS computer.

Viewing the SAS Log at the z/OS Source Computer (Part 4 of 4)

NOTE: SAS (r) Proprietary Software Release 6.09.0460P030498
       Licensed to SAS INSTITUTE INC., Site 0000000001.
NOTE: Running on IBM Model 9672,
                 IBM Model 9672,
                 IBM Model 9672.

NOTE: No options specified.

/*---------------------------------------*/
/* Assigns the SAS test library XPORTIN. */
/*---------------------------------------*/
libname xportin xport;
NOTE: Libref XPORTIN was successfully assigned
  as follows:
      Engine:        XPORT
      Physical Name: JOE.XPORTIN.DAT
/*---------------------------------------------*/
/* Reads the transport file and writes the     */
/* test data sets to the library WORK.         */
/*---------------------------------------------*/
proc copy in=xportin out=work;
run;

NOTE: Input library XPORTIN is sequential.
NOTE: Copying XPORTIN.GRADES to WORK.GRADES
  (MEMTYPE=DATA).
NOTE: BUFSIZE is not cloned when copying across
  different engines. System Option for BUFSIZE was used.
NOTE: The data set WORK.GRADES has 2 observations
  and 4 variables.
NOTE: Copying XPORTIN.NUMBERS to WORK.NUMBERS
  (MEMTYPE=DATA).
NOTE: BUFSIZE is not cloned when copying across
  different engines. System Option for BUFSIZE was used.
NOTE: The data set WORK.NUMBERS has 10 observations
   and 1 variables.
NOTE: Copying XPORTIN.SIMPLE to WORK.SIMPLE
  (MEMTYPE=DATA).

Note:   The notes about the SAS system option BUFSIZE do not indicate an error condition. BUFSIZE specifies the permanent buffer size for an output data set, which can be adjusted to improve system performance. The system value that is assigned to the BUFSIZE option is used because the XPORT engine does not support the BUFSIZE= option. See your operating environment companion documentation for details.  [cautionend]

Previous Page | Next Page | Top of Page