OpenVMS Alpha to UNIX File Transport


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

The following example shows a SAS program that creates three data sets in OpenVMS Alpha format and translates them to transport format.

Example Code 13.1: SAS Program That Creates Data Sets and Transport Files
start example
 libname xptlib xport 'xptlib.dat';  [1] libname xptds xport 'xptds.dat';  [2]    /* creates data set GRADES; contains numeric and */    /* character data */ data grades;  [3]    input student $ test1 test2 final;    datalines;    Fred 66 80 70    Wilma 97 91 98    ;   /* creates data set SIMPLE; contains */   /* character data only */ data simple;  [4]    x='dog';    y='cat';    z='fish'; run;   /* creates data set NUMBERS; contains */   /* numeric data only */ data numbers;  [5]    do i=1 to 10;       output;    end; run;  /* create a transport file for the entire library */ proc copy in=work out=xptlib;  [6] run;  /* create a transport file for a data set */ proc copy in=work out=xptds;  [7]    select grades; run; 
end example
 
[1]  

The LIBNAME statement assigns the libref XPTLIB to the physical location XPTLIB.DAT, which stores the entire library to be created. The XPORT engine creates XPTLIB.DAT.

[2]  

The LIBNAME statement assigns the libref XPTDS to the physical location XPTDS.DAT, which stores the single data set to be created. The XPORT engine creates XPTDS.DAT.

[3]  

The DATA step creates the data set, WORK.GRADES, which contains two observations. Each observation contains four variables (one character and three numeric values).

[4]  

The DATA step creates a second data set, WORK.SIMPLE, which contains a single observation. The observation contains three character values.

[5]  

The DATA step creates a third data set, WORK.NUMBERS, which contains ten observations. Each observation contains a single numeric value.

[6]  

PROC COPY copies all three data sets from the default WORK library to the new library XPTLIB. The WORK data sets are written to the output library XPTLIB in transport format.

[7]  

PROC COPY copies the selected data set GRADES to the new library XPTDS. The data set GRADES is written to output library XPTDS in transport format.

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 in "Using PROC COPY at the Source Operating Environment to Create Transport Files" on page 84.

Example Code 13.2: Source Operating Environment SAS Log
start example
 NOTE: SAS (r) Proprietary Software Release 6.12  TS050   [1] NOTE: Running on DEC Model 7000 MODEL 740 Serial Number 80000000.  [2] NOTE: Libref XPTLIB was successfully assigned as follows:  [3]       Engine:        XPORT       Physical Name: Device:  system-specific file/pathname  XPTLIB.DAT NOTE: Libref XPTDS was successfully assigned as follows:  [4]       Engine:        XPORT       Physical Name:  system-specific file/pathname  XPTDS.DAT NOTE: The data set WORK.GRADES has 2 observations and 4 variables.  [5] NOTE: The data set WORK.SIMPLE has 1 observations and 3 variables. NOTE: The data set WORK.NUMBERS has 10 observations and 1 variables. NOTE: Copying WORK.GRADES to XPTLIB.GRADES (MEMTYPE=DATA).  [6] 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. NOTE: Copying WORK.GRADES to XPTDS.GRADES (MEMTYPE=DATA).  [7] 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. 
end example
 

The next series of notes report that SAS copies WORK.GRADES to XPTLIB.GRADES, WORK.NUMBERS to XPTLIB.NUMBERS, and WORK.SIMPLE to XPTLIB.SIMPLE. The XPORT engine translates each data set from OpenVMS Alpha format to transport format.

[1]  

The source operating environment runs SAS 6.12, which means that the SAS session default library engine is V612.

[2]  

The source operating environment is a DEC Model 7000, which refers to AX7000 (OpenVMS Alpha).

[3]  

SAS assigns the libref XPTLIB to the physical device whose specification is platform-dependent. The XPORT engine creates XPTLIB.

[4]  

SAS assigns the libref XPTDS to the physical device whose specification is platform-dependent. The XPORT engine creates XPTDS.

[5]  

The first three notes in this series report the creation of the data sets WORK.GRADES, WORK.SIMPLE, and WORK.NUMBERS.

[6]  
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.

[7]  

SAS copies WORK.GRADES to XPTDS.GRADES. The XPORT engine translates the data set from OpenVMS Alpha format to transport format.

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 the transport 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 the Transport Files to the Target Operating Environment

Before you transfer a transport file to the target operating environment, verify its file attributes. The following example shows typical output:

Example Code 13.3: Using DIR/FULL to Verify the Attributes of the Transport File
start example
 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    Record format:      Fixed length 80 byte records  [1]    Record attributes:  None  [2]    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. 
end example
 
[1]  

The RECORD FORMAT attribute indicates a fixed record type and an 80-byte record size. These values are required for a successful file transfer across the network.

[2]  

The RECORD ATTRIBUTES field should contain the value NONE.

Caution  

If this field contains CARRIAGE RETURN CARRIAGE CONTROL, file corruption results. To prevent corruption before you transfer the transport file, remove this value from the RECORD ATTRIBUTES field. An error message alerts you to this condition after you attempt to transfer the corrupted file.

After you verify the attributes of a transport file, use FTP to transfer the transport file to the target operating environment.

In this example, the target operating environment retrieves the transport file from the source operating environment because the source operating environment does not have permission to write to the target operating environment directory. A source operating environment is unlikely to have permission to write a transport file to a target operating environment.

At the target operating environment, 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.

Example Code 13.4: FTP Dialog
start example
 hp> ftp ax7000.vms.sas.com  [1]    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. ftp> cd [.xpttest]  [2]    250 Connected to system-specific file/pathname. ftp> binary  [3]    200 Type I ok. ftp> get xptds.dat xptds.dat  [4]    200 Port 14.83 at Host 10.26.2.45 accepted.    150 IMAGE retrieve of system-specific file/pathname XPTDS.DAT;1 started. 226 Transfer completed.  1360 (8) bytes transferred.  [5]    1360 bytes received in 0.02 seconds (87.59 Kbytes/s) ftp> get xptlib.dat xptlib.dat  [6]    200 Port 14.84 at Host 10.26.2.45 accepted.    150 IMAGE retrieve of system-specific file/pathname XPTLIB.DAT;1 started. 226 Transfer completed.  3120 (8) bytes transferred.  [7]    3120 bytes received in 0.04 seconds (85.81 Kbytes/s) ftp> quit  [8] 
end example
 
[1]  

From the UNIX target operating environment, the user invokes FTP to connect to the OpenVMS Alpha source operating environment AX7000.VMS.SAS.COM.

[2]  

After a connection is established, at the FTP prompt, user JOE changes to the subdirectory on the source operating environment that contains the transport files.

[3]  

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

[4]  

The FTP get command obtains the transport file named XPTDS.DAT from the source operating environment and copies it to a new file that has the same name, XPTDS.DAT, in the target operating environment current directory.

[5]  

Messages indicate that the transfer was successful and that the size of the transport file was 1360 bytes. Compare the sizes of the transport files at the source operating environment and the target operating environment. If the sizes are identical, then the network successfully transferred the file. For details about listing file size, see "Verifying the Size of a Transport File" on page 105.

[6]  

The FTP get command obtains another transport file named XPTLIB.DAT from the source operating environment and copies it to a new file that has the same name, XPTLIB.DAT, in the target operating environment current directory.

[7]  

Messages indicate that the transfer was successful. Compare the sizes of the transport files at the source operating environment and the target operating environment.

[8]  

The user quits the FTP session.

For complete details about using the file transfer utility, see your FTP documentation.

Using PROC COPY at the Target Operating Environment to Restore Transport Files into Native Format

The following example shows a SAS program that translates a transport file to native file format.

Example Code 13.5: SAS Program That Restores Transport Files into Native File Format
start example
 libname xptlib xport 'xptlib.dat';  [1] libname xptds xport 'xptds.dat';  [2] libname natvlib v7 'natvlib'  [3] libname natvds v7 'natvds';  [4]   /* translate transport file for library */   /* to native format on target operating environment.      */ proc copy in=xptlib out=natvlib;  [5] run;   /* translate transport file for data set*/   /* to native format on target operating environment */ proc copy in=xptds out=natvds;  [6]    select grades; run; 
end example
 
[1]  

The LIBNAME statement assigns the libref XPTLIB to the physical location XPTLIB.DAT, which stores the entire library that was transferred to the target operating environment. The XPORT engine reads XPTLIB.

[2]  

The LIBNAME statement assigns the libref XPTDS to the physical location XPTDS.DAT, which stores the single data set that was transferred to the target operating environment. The XPORT engine reads XPTDS.

[3]  

The LIBNAME statement assigns the libref NATVLIB to the physical location NATVLIB, which stores the entire library to be translated from transport format to native format. The V7 engine creates NATVLIB.

[4]  

The LIBNAME statement assigns the libref NATVDS to the physical location NATVDS, which stores the single data set to be translated from transport format to native format. The V7 engine creates NATVDS.

[5]  

PROC COPY copies all three data sets from the libref XPTLIB to the new libref NATVLIB. The XPORT engine reads all data sets from XPTLIB in transport format. The V7 engine writes the data sets to the output libref NATVLIB in native UNIX format.

[6]  

PROC COPY selects the data set GRADES to copy to the new library NATVDS. The XPORT engine reads the data set GRADES in transport format. The V7 engine writes the output library XPTDS in native UNIX 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 shown in "Using PROC COPY at the Target Operating Environment to Restore Transport Files into Native Format" on page 89.

Example Code 13.6: Target Operating Environment SAS Log
start example
 NOTE: Copyright (c) 1999 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software Version 8 (TS00.00P1D090398)  [1]       Licensed to SAS Institute Inc., Site 0000000001. NOTE: This session is executing on the UNIX B.10.20 platform.  [2] 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 operating environment.                      */ proc copy in=xptlib out=natvlib; run; NOTE: Input library XPTLIB is sequential. NOTE: Copying XPTLIB.GRADES to NATVLIB.GRADES (memtype=DATA).  [7] 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. NOTE: Copying XPTLIB.NUMBERS to NATVLIB.NUMBERS (memtype=DATA).  [8] 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. NOTE: Copying XPTLIB.SIMPLE to NATVLIB.SIMPLE (memtype=DATA).  [9] 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 operating environment                                */ proc copy in=xptds out=natvds;   select grades; run; NOTE: Input library XPTDS is sequential. NOTE: Copying XPTDS.GRADES to NATVDS.GRADES (memtype=DATA).  [10] 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 
end example
 
[1]  

The target operating environment runs SAS 8, which means that the SAS session on the target operating environment uses the default library engine V8.

[2]  

The target operating environment runs UNIX.

[3]  

The LIBNAME statement assigns the libref XPTLIB to the physical device whose specification is platform-dependent. In this example, the physical device indicates a UNIX operating environment. The XPORT engine reads XPTLIB.

[4]  

The LIBNAME statement assigns the libref XPTDS to the physical device whose specification is platform-dependent. The XPORT engine reads XPTDS.

[5]  

The LIBNAME statement assigns the libref NATVLIB to the physical device whose specification is platform-dependent. In this example, the physical device indicates a UNIX operating environment. The V7 engine writes to NATVLIB.

[6]  

The LIBNAME assigns the libref NATVDS to the physical device whose specification is platform-dependent. In this example, the physical device indicates a UNIX operating environment. The V7 engine writes to NATVDS.

[7]  

PROC COPY copies XPTLIB.GRADES to NATVLIB.GRADES. The NATVLIB data set is written in V7 format.

[8]  

PROC COPY copies XPTLIB.NUMBERS to NATVLIB.NUMBERS. The NATVLIB data set is written in V7 format.

[9]  

PROC COPY copies XPTLIB.SIMPLE to NATVLIB.SIMPLE. The NATVLIB data set is written in V7 format.

[10]  

PROC COPY copies XPTDS.GRADES to NATVDS.GRADES. The NATVDS data set is written in V7 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