zOS to Windows File Transport


z/OS to Windows File Transport

Using PROC CPORT at the Source Operating Environment to Create Transport Files

The following example shows a SAS program that copies two data sets and two catalogs from a library in z/OS format and writes them to a default output file in transport format.

Example Code 13.7: SAS Program That Copies Data Sets and Catalogs to a Transport File
start example
 filename tport 'joe.mytest.data' disp=rep; libname test 'joe.mytest.sas'; proc cport library=test file=tport; run; 
end example
 

The LIBNAME statement assigns the libref TEST to the physical location JOE.MYTEST.SAS, which points to the library to be transported. JOE is the userid that is associated with the SAS session in which the transport operation is performed. The FILENAME statement assigns the fileref TPORT to the transport file JOE.MYTEST.DATA. DISP=REP will create a new file or replace an existing file.

Viewing the SAS Log at the Source Operating Environment

The following example shows a SAS log that documents the successful execution of the SAS program shown in "Using PROC CPORT at the Source Operating Environment to Create Transport Files" on page 91.

Example Code 13.8: Source Operating Environment SAS Log File
start example
 filename tport 'joe.mytest.data'; libname test 'joe.mytest.sas'; proc cport lib=test file=tport; run; WARNING: No output file is specified. Default output file JOE.SASCAT.DATA is used. NOTE: Proc CPORT begins to transport data set TEST.CITY NOTE: The data set contains 7 variables and 72 observations. NOTE: Transporting data set index information. NOTE: Proc CPORT begins to transport catalog TEST.FORMATS NOTE: The catalog has 3 entries NOTE: Transporting entry REGFMT  .FORMATC NOTE: Transporting entry SALEFMT .FORMATC NOTE: Transporting entry SIZEFMT .FORMATC NOTE: Proc CPORT begins to transport catalog TEST.TEST NOTE: The catalog has 11 entries NOTE: Transporting entry ABOUT   .CBT NOTE: Transporting entry APPEND  .CBT NOTE: Transporting entry BOOKMENU.CBT NOTE: Transporting entry DEFAULT .FORM NOTE: Transporting entry HELP    .HELP NOTE: Transporting entry CLIST   .LIST NOTE: Transporting entry ENTRYTYP.LIST NOTE: Transporting entry SPELLALL.PMENU NOTE: Transporting entry SPELLSUG.PMENU NOTE: Transporting entry ADDON1  .PROGRAM NOTE: Transporting entry ADDON2  .PROGRAM NOTE: Proc CPORT begins to transport data set TEST.VARNUM NOTE: The data set contains 10 variables and 100 observations. 
end example
 
Note  

Default output filenames are operating environment specific.

PROC CPORT reads the contents of the entire library that is referenced by the libref TEST and writes to the default transport file. The remaining series of notes indicate that PROC CPORT transports the data set TEST.CITY, the catalog TEST.FORMATS, the catalog TEST.TEST, and the data set TEST.VARNUM into the transport file JOE.MYTEST.DATA.

Verifying Transport Files

It is recommended that you verify the integrity of your transport files at the source operating environment before the files are transferred to the target operating environment. A successful verification at the source operating environment can eliminate the possibility that the transport file was created incorrectly. Also, after you transfer a file to the target operating environment, you can compare the transport file that was sent from the source operating environment with the file that was received at the target operating environment. See "Strategies for Verifying Transport Files" on page 104 for details.

Transferring Transport Files to the Target Operating Environment

Verify the file attributes of the transport files before they are transferred to the target operating environment. The following example shows typical output for TSO.

Example Code 13.9: Using TSO LISTD Command to Verify the Attributes of the Transport File
start example
 listd "  userid  .mytest.data"  USERID  .MYTEST.DATA --RECFM-LRECL-BLKSIZE-DSORG   FB    80    8000    PS --VOLUMES--   APP009 
end example
 

After you verify the attributes of the transport files, you can use FTP to transfer them over the network. Change the default DCB attributes, as necessary, in the FTP dialog. In this example, because the user on the source operating environment has permission to write to the target operating environment, the FTP put command is used to write the transport file to the target operating environment.

The following example shows the FTP commands you specify at the source operating environment to write the transport files to the target operating environment.

Example Code 13.10: FTP Dialog
start example
 ftp mypc   [1]  EZA1450I MVS TCP/IP FTP V3R2  EZA1554I Connecting to SPIDER 10.24.2.32, port 21  220 spider FTP server (Version 4.162 Tue Nov 1   10:50:37 PST 1988) ready.  EZA1459I USER (identify yourself to the host): userid password  EZA1701I >>>USER joe  331 Password required for joe.  EZA1701I >>>PASS ********  230 User joe logged in.  EZA1460I Command:  [2] binary  EZA1701I >>>TYPE i  200 Type set to I.  EZA1460I Command:  [3] put 'joe.mytest.data' c:\tport.dat EZA1701I >>>SITE VARrecfm Lrecl=80  [4]  Recfm=FB BLKSIZE=8000 500 'SITE VARRECFM Lrecl=80 Recfm=FB BLKSIZE=23440':  EZA1701I >>>PORT 10,253,1,2,129,50 200 PORT command EZA1701I >>>STOR c:\tport.dat  [5] 150 Opening BINARY mode data connection for c:\tport.dat 226 Transfer complete.  [6] EZA2517I 6071600 bytes transferred in 13 seconds.  Transfer rate 466.18 Kbytes/sec. EZA1460I Command:  [7] quit  EZA1701I >>>QUIT  221 Goodbye.  READY 
end example
 
[1]  

From the z/OS source operating environment, the user invokes FTP to connect to the Windows target operating environment MYPC.

[2]  

The transport file attribute BINARY indicates that the z/OS transport file should be transferred from the source operating environment in BINARY format.

[3]  

The FTP put command copies the transport file named JOE.MYTEST.DATA from the source operating environment to the target operating environment physical location C:\TPORT.DAT.

[4]  

The FTP file attribute commands indicate a record length of 80 bytes, a fixed record type, and a block size of 8000.

[5]  

TPORT.DAT is saved to drive C.

[6]  

Messages indicate that the transfer was successful. For details about listing a file size, see "Verifying the Size of a Transport File" on page 105.

[7]  

The user quits the FTP session.

Using PROC CIMPORT at the Target Operating Environment to Import Transport Files into Native Format

The following example shows a SAS program that translates the transport file from transport format into native format.

Example Code 13.11: SAS Program That Imports Transport Files into Native Format
start example
 libname newlib 'c:\mylib'; proc cimport infile='c:\tport.dat' library=newlib; run; 
end example
 

This LIBNAME statement assigns the libref NEWLIB to the physical location c:\mylib , which stores the entire V7 library. PROC CIMPORT reads the entire content of the transport file that is identified in the INFILE= option and writes it to the output location that is identified in the LIBNAME= option.

As an alternative to importing the entire contents of the library into native V7 format, you can select or exclude specific entities from the transport library.

Here are examples:

Example Code 13.12: Selecting One or More Data Sets
start example
 filename target 'c:\tport.dat'; libname newlib 'c:\mylib'; proc cimport infile=target library=newlib;    select varnum; run; 
end example
 

In the preceding example, the fileref TARGET points to the location where the transport file was transferred to the target operating environment. The libref NEWLIB points to the location to store the selected member. PROC CIMPORT reads the entire content of the transport file that is identified in the INFILE= option and writes only the member that is identified in the SELECT statement. The data set VARNUM is written to the library NEWLIB in Windows format.

Example Code 13.13: Selecting a Catalog Entry Type
start example
 filename target 'c:\tport.dat'; libname newlib 'c:\mylib'; proc cimport infile=target library=newlib   memtype=catalog et=program; run; 
end example
 

In the preceding example, PROC CIMPORT reads the entire content of the transport file that is identified in the INFILE= option and writes only members of type CATALOG and entries of type PROGRAM to the library NEWLIB in Windows format.

Example Code 13.14: Selecting Catalog Entries
start example
 filename target 'c:\tport.dat'; libname newlib 'c:\mylib'; proc cimport infile=target library=newlib memtype=cat;   select spellsug.pmenu addon1.program; run; 
end example
 

In the preceding example, PROC CIMPORT reads the entire content of the transport file that is identified in the INFILE= option and writes only the entries SPELLSUG.PMENU and ADDON1.PROGRAM of member type CATALOG to the library NEWLIB in Windows format.

Viewing the SAS Log at the Target Operating Environment

The following example shows a SAS log that documents the successful execution of the SAS program that is shown in "Using PROC CIMPORT at the Target Operating Environment to Import Transport Files into Native Format" on page 94.

Example Code 13.15: Target Operating Environment Log File
start example
 NOTE: Proc CIMPORT begins to create/update data set NEWLIB.CITY NOTE: The data set index REGION is defined. NOTE: Data set contains 7 variables and 72 observations. NOTE: Proc CIMPORT begins to create/update catalog NEWLIB.FORMATS NOTE: Entry REGFMT.FORMATC has been imported. NOTE: Entry SALEFMT.FORMATC has been imported. NOTE: Entry SIZEFMT.FORMATC has been imported. NOTE: Total number of entries processed in catalog NEWLIB.FORMATS: 3 NOTE: Proc CIMPORT begins to create/update catalog NEWLIB.TEST NOTE: Entry ABOUT.CBT has been imported. NOTE: Entry APPEND.CBT has been imported. NOTE: Entry BOOKMENU.CBT has been imported. NOTE: Entry DEFAULT.FORM has been imported. NOTE: Entry HELP.HELP has been imported. NOTE: Entry CLIST.LIST has been imported. NOTE: Entry ENTRYTYP.LIST has been imported. NOTE: Entry SPELLALL.PMENU has been imported. NOTE: Entry SPELLSUG.PMENU has been imported. NOTE: Entry ADDON1.PROGRAM has been imported. NOTE: Entry ADDON2.PROGRAM has been imported. NOTE: Total number of entries processed in catalog NEWLIB.TEST: 11 NOTE: Proc CIMPORT begins to create/update data set NEWLIB.VARNUM NOTE: Data set contains 10 variables and 100 observations. 
end example
 

PROC CIMPORT creates the data set NEWLIB.CITY, the catalog NEWLIB.FORMATS, the catalog NEWLIB.TEST, and the data set NEWLIB.VARNUM at the target operating environment, Windows, in Windows format.




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