Chapter Contents |
Previous |
Next |
Moving and Accessing SAS Files across Operating Environments |
Using PROC COPY at the Source Host to Create Transport Files |
SAS Program That Creates Data Sets and Transport Files
[1] libname xptlib xport 'xptlib.dat'; [2] libname xptds xport 'xptds.dat'; /* creates data set GRADES; contains numeric and */ /* character data */ [3] data grades; input student $ test1 test2 final; datalines; Fred 66 80 70 Wilma 97 91 98 ; /* creates data set SIMPLE; contains */ /* character data only */ [4] data simple; x='dog'; y='cat'; z='fish'; run; /* creates data set NUMBERS; contains */ /* numeric data only */ [5] data numbers; do i=1 to 10; output; end; run; /* create a transport file for the entire library */ [6] proc copy in=work out=xptlib; run; /* create a tranport file for a dataset */ [7] proc copy in=work out=xptds; select grades; run;
Viewing the SAS Log at the Source Host |
The following example shows a SAS log that documents the successful execution of the SAS program in Using PROC CPORT at the Source Host to Create Transport Files: OS/390.
Source Host SAS Log
[1] NOTE: SAS (r) Proprietary Software Release 6.12 TS050 [2] NOTE: Running on DEC Model 7000 MODEL 740 Serial Number 80000000. [3] NOTE: Libref XPTLIB was successfully assigned as follows: Engine: XPORT Physical Name: Device:system-specific file/pathname XPTLIB.DAT [4] NOTE: Libref XPTDS was successfully assigned as follows: Engine: XPORT Physical Name:system-specific file/pathname XPTDS.DAT [5] NOTE: The data set WORK.GRADES has 2 observations and 4 variables. NOTE: The data set WORK.SIMPLE has 1 observations and 3 variables. NOTE: The data set WORK.NUMBERS has 10 observations and 1 variables. [6] NOTE: Copying WORK.GRADES to XPTLIB.GRADES (MEMTYPE=DATA). NOTE: BUFSIZE is not cloned when copying across dissimilar engines. System Option for BUFSIZE was used. NOTE: The data set XPTLIB.GRADES has 2 observations and 4 variables. NOTE: Copying WORK.NUMBERS to XPTLIB.NUMBERS (MEMTYPE=DATA). NOTE: BUFSIZE is not cloned when copying across dissimilar engines. System Option for BUFSIZE was used. NOTE: The data set XPTLIB.NUMBERS has 10 observations and 1 variables. NOTE: Copying WORK.SIMPLE to XPTLIB.SIMPLE (MEMTYPE=DATA). NOTE: BUFSIZE is not cloned when copying across dissimilar engines. System Option for BUFSIZE was used. NOTE: The data set XPTLIB.SIMPLE has 1 observations and 3 variables. [7] NOTE: Copying WORK.GRADES to XPTDS.GRADES (MEMTYPE=DATA). NOTE: BUFSIZE is not cloned when copying across dissimilar engines. System Option for BUFSIZE was used. NOTE: The data set XPTDS.GRADES has 2 observations and 4 variables.
Note: The following 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.
Verifying 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 the transport 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 |
Using DIR/FULL to Verify the Attributes of the Transport File
vms> DIR/FULL xptlib.dat Directory HOSTVAX:[JOE.XPTTEST] XPTLIB.DAT;1 File ID: (31223,952,0) Size: 7/8 Owner: [HOSTVAX,JOE] Created: 30-SEP-1999 16:47:31.34 Revised: 30-SEP-1999 16:47:31.69 (1) Expires: Effective: File organization: Sequential Shelved state: Online File attributes: Allocation: 8, Extend: 0, Global buffer count: 0 Version limit: 2 [1] Record format: Fixed length 80 byte records [2] Record attributes: None RMS attributes: None Journaling enabled: None File protection: System:RWED, Owner:RWED, Group:RE, World: Access Cntrl List: None Total of 1 file, 7/8 blocks. $ dir/size xptlib.dat Directory HOSTVAX:[JOE.XPTTEST] XPTLIB.DAT;1 7 Total of 1 file, 7 blocks.
An OpenVMS Alpha host RECORD FORMAT should indicate a record length of 512 bytes.
After you verify the attributes of a transport file, use FTP to transfer the transport file to the target host.
In this example, the target host retrieves the transport file from the source host because the source host does not have permission to write to the target host directory. A source host is unlikely to have permission to write a transport file to a target host.
At the target host, change the directory to the location where the transport file will be copied. The following example shows how to use FTP commands to get the transport files.
Typical FTP Dialog
[1] hp> ftp ax7000.vms.sas.com Connected to ax7000.vms.com. 220 ax7000.vms.com MultiNet FTP Server Process V4.0(15) at Thu-Sep 30-99 12:59PM-EDT Name (ax7000.vms.com:): joe 331 User name (joe) ok. Password, please. Password: 230 User JOE logged into HOSTVAX:[JOE] at Thu 30-Sep-99 12:59PM-EDT, job 27a34cef. Remote system type is VMS. [2] ftp> cd [.xpttest] 250 Connected to system-specific file/pathname. [3] ftp> binary 200 Type I ok. [4] ftp> get xptds.dat xptds.dat 200 Port 14.83 at Host 10.26.2.45 accepted. 150 IMAGE retrieve of system-specific file/pathname XPTDS.DAT;1 started. [5] 226 Transfer completed. 1360 (8) bytes transferred. 1360 bytes received in 0.02 seconds (87.59 Kbytes/s) [6] ftp> get xptlib.dat xptlib.dat 200 Port 14.84 at Host 10.26.2.45 accepted. 150 IMAGE retrieve of system-specific file/pathname XPTLIB.DAT;1 started. [7] 226 Transfer completed. 3120 (8) bytes transferred. 3120 bytes received in 0.04 seconds (85.81 Kbytes/s) [8] ftp> quit
get
command obtains the transport file named XPTDS.DAT from the source
host and copies it to a new file that has the same name, XPTDS.DAT, in the
target host current directory.
get
command obtains another transport file named XPTLIB.DAT from the
source host and copies it to a new file that has the same name, XPTLIB.DAT,
in the target host current directory.
For complete details about using the file transfer utility, see your FTP documentation.
Using PROC COPY at the Target Host to Restore Transport Files into Native Format |
The following example shows a SAS program that translates a transport file to native file format.
SAS Program That Restores Transport Files into Native File Format
[1] libname xptlib xport 'xptlib.dat'; [2] libname xptds xport 'xptds.dat'; [3] libname natvlib v7 'natvlib'; [4] libname natvds v7 'natvds'; /* translate transport file for library */ /* to native format on target host. */ [5] proc copy in=xptlib out=natvlib; run; /* translate transport file for data set*/ /* to native format on target host */ [6] proc copy in=xptds out=natvds; select grades; run;
Viewing the SAS Log at the Target Host |
The following example shows a SAS log that documents the successful execution of the SAS program shown in Using PROC COPY at the Target Host to Restore Transport Files into Native Format.
Target Host SAS Log
NOTE: Copyright (c) 1999 by SAS Institute Inc., Cary, NC, USA. [1] NOTE: SAS (r) Proprietary Software Version 7 (TS00.00P1D090398) Licensed to SAS Institute Inc., Site 0000000001. [2] NOTE: This session is executing on the HP-UX B.10.20 platform. NOTE: Running on HP Model 9000/715 Serial Number 2005516582. libname xptlib xport 'xptlib.dat'; [3] NOTE: Libref XPTLIB was successfully assigned as follows: Engine: XPORT Physical Name: system-specific file/pathname/xptlib.dat libname xptds xport 'xptds.dat'; [4] NOTE: Libref XPTDS was successfully assigned as follows: Engine: XPORT Physical Name: system-specific file/pathname/xptds.dat libname natvlib v7 'natvlib'; [5] NOTE: Libref NATVLIB was successfully assigned as follows: Engine: V7 Physical Name: system-specific file/pathname/natvlib libname natvds v7 'natvds'; [6] NOTE: Libref NATVDS was successfully assigned as follows: Engine: V7 Physical Name: system-specific file/pathname/natvds /* translate transport file for library to native */ /* format on target host. */ proc copy in=xptlib out=natvlib; run; NOTE: Input library XPTLIB is sequential. [7] NOTE: Copying XPTLIB.GRADES to NATVLIB.GRADES (memtype=DATA). NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used. NOTE: The data set NATVLIB.GRADES has 2 observations and 4 variables. [8] NOTE: Copying XPTLIB.NUMBERS to NATVLIB.NUMBERS (memtype=DATA). NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used. NOTE: The data set NATVLIB.NUMBERS has 10 observations and 1 variables. [9] NOTE: Copying XPTLIB.SIMPLE to NATVLIB.SIMPLE (memtype=DATA). NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used. NOTE: The data set NATVLIB.SIMPLE has 1 observations and 3 variables. /* translate transport file for data set to native */ /* on target host */ proc copy in=xptds out=natvds; select grades; run; NOTE: Input library XPTDS is sequential. [10] NOTE: Copying XPTDS.GRADES to NATVDS.GRADES (memtype=DATA). NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used. NOTE: The data set NATVDS.GRADES has 2 observations and 4 variables
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.