Chapter Contents

Previous

Next
Moving and Accessing SAS Files across Operating Environments

OS/390 to Windows NT File Transport


Using PROC CPORT at the Source Host to Create Transport Files

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

SAS Program That Copies Data Sets and Catalogs to a Transport File
libname test 'joe.mytest.sas'; proc cport library=test; run;

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. Because no FILE= option is provided, SAS uses the OS/390 default transport file name userid.SASCAT.DATA. PROC CPORT reads the contents of the library TEST and writes the library contents to the default output file in transport format.


Viewing the SAS Log at the Source Host

The following example shows a SAS log that documents the successful execution of the SAS program shown in Using PROC CPORT at the Source Host to Create Transport Files.

Source Host SAS Log File
libname test 'joe.mytest.sas'; proc cport lib=test; 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.

Note:   Default output filenames are host-specific.  [cautionend]
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 data set TEST.VARNUM into the transport file JOE.SASCAT.DATA.


Verifying the Transport Files

You are advised to verify the integrity of your transport files at the source host before the files are transferred to the target host. A successful verification at the source host can eliminate the possibility that the transport file was created incorrectly. Also, after you transfer a file to the target host, you can compare the transport file that was sent from the source host with the file that was received at the target host. See Methods for Verifying Transport Files for details.


Transferring the Transport Files to the Target Host

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

Using TSO LISTD Command to Verify the Attributes of the Transport File
listd "userid.xportout.dat" USERID.XPORTOUT.DAT --RECFM-LRECL-BLKSIZE-DSORG FB 80 8000 PS --VOLUMES-- APP009

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 host has permission to write to the target host, the FTP put command is used to write the transport file to the target host.

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

Typical FTP Dialog
[1] ftp mypc 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. [2] EZA1460I Command: binary EZA1701I >>>TYPE i 200 Type set to I. [3] EZA1460I Command: put 'joe.sascat.data' c:\tport.dat [4] EZA1701I >>>SITE VARrecfm Lrecl=80 Recfm=FB BLKSIZE=8000 500 'SITE VARRECFM Lrecl=80 Recfm=FB BLKSIZE=23440': EZA1701I >>>PORT 10,253,1,2,129,50 200 PORT command [5] EZA1701I >>>STOR c:\tport.dat 150 Opening BINARY mode data connection for c:\tport.dat [6] 226 Transfer complete. EZA2517I 6071600 bytes transferred in 13 seconds. Transfer rate 466.18 Kbytes/sec. [7] EZA1460I Command: quit EZA1701I >>>QUIT 221 Goodbye. READY
  1. From the OS/390 source host, the user invokes FTP to connect to the Windows NT target host MYPC.

  2. The transport file attribute BINARY indicates that the OS/390 transport file should be transferred from the source host in BINARY format .

  3. The FTP put command copies the transport file named JOE.SASCAT.DATA from the source host to the target host 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.

  7. The user quits the FTP session.


Using PROC CIMPORT at the Target Host 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.

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

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:

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

In the preceding example, the fileref TARGET points to the location where the transport file was transferred to the target host. 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.

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

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.

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

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 Host

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 Host to Import Transport Files into Native Format.

Target Host Log File
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.

PROC CIMPORT creates the data set NEWLIB.CITY, the catalog NEWLIB.FORMAT, the catalog NEWLIB.TEST, and the data set NEWLIB.VARNUM at the target host Windows NT in Windows format.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.