zOS JCL Batch to UNIX File Transport


z/OS JCL Batch to UNIX File Transport

The z/OS JCL Batch Program

Although presented in four parts, the following program is designed as a single program. The parts perform these tasks :

  1. Use PROC COPY to create a transport file on the z/OS source operating environment.

  2. Transfer the transport file over the network to the UNIX target operating environment.

  3. Verify the accuracy of the transport file.

  4. Use PROC COPY to restore the transport file to the z/OS source operating environment.

Embedded comments document the program.

Using PROC COPY to Create a Transport File

The following example 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 documents the execution of this program part, see "Recording the Creation of Data Sets and Transport Files in the SAS Log" on page 100.

Example Code 13.16: Creating Data Sets and Transport Files
start example
 //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; /* 
end example
 

Transferring the Transport File Across the Network

The following example shows the generation of the FTP command file and the transfer of the transport file over the network to the target operating environment. For details in the SAS log that documents the execution of this program part, see "Recording the Transfer of the Transport File to the Target Operating Environment in the SAS Log" on page 102.

Example Code 13.17: Using FTP to Transfer Transport Files
start example
 //*------------------------------------------------- //* Generate FTP command file for sending XPORTOUT //* test library to the target operating environment. //*------------------------------------------------- //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 operating environment. //*---------------------------------------------- //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 /* 
end example
 

Verifying the Accuracy of the Transport File

The following example shows the verification of the transport file by transferring it from the UNIX target operating environment to the z/OS source operating environment 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 document the execution of this program part, see "Recording the Verification of the Transport File in the SAS Log" on page 103.

Example Code 13.18: Verifying Transport Files
start example
 //*------------------------------------------------- //* The following steps retrieve the XPORTOUT library //* from the target operating environment 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 operating environment. //*------------------------------------------------- //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 operating environment 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 /* 
end example
 

Using PROC COPY to Restore the Transport File

The following example restores the transport file to native format on the z/OS source operating environment. For details in the SAS log that document the execution of this program part, see "Recording the Restoration of the Transport File to the Source Operating Environment in the SAS Log" on page 103.

Example Code 13.19: Restoring the Transport File to Native Format
start example
 //*---------------------------------------------- //* 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; /* 
end example
 

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

The following example shows the SAS log that documents the creation of the data sets and corresponding transport files.

Example Code 13.20: Viewing the SAS Log at the z/OS Source Operating Environment (Part 1 of 4)
start example
 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. 
end example
 
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.

Recording the Transfer of the Transport File to the Target Operating Environment in the SAS Log

The following example shows the SAS log that documents the transfer of the transport file to the target operating environment.

Example Code 13.21: Viewing the SAS Log at the z/OS Source Operating Environment (Part 2 of 4)
start example
 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 
end example
 

Recording the Verification of the Transport File in the SAS Log

The following example shows the SAS log that documents the portion of the program that verifies the accuracy of the transport files that were transferred.

Example Code 13.22: Viewing the SAS Log at the z/OS Source Operating Environment (Part 3 of 4)
start example
 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 
end example
 

Recording the Restoration of the Transport File to the Source Operating Environment in the SAS Log

The following example shows the SAS log that documents the part of the program that copies the transport file to native format on the z/OS operating environment.

Example Code 13.23: Viewing the SAS Log at the z/OS Source Operating Environment (Part 4 of 4)
start example
 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). 
end example
 
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.




Moving and Accessing SAS 9.1 Files
Moving And Accessing SAS 9.1 Files
ISBN: 1590472306
EAN: 2147483647
Year: 2004
Pages: 109
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net