Flylib.com

Books Software

 
 
 

Chapter 4: XPORT Engine with DATA Step or PROC COPY


Chapter 4: XPORT Engine with DATA Step or PROC COPY

Overview of the XPORT Engine

The XPORT engine creates files in transport format , which uses an environment-independent standard for character encoding and numeric representation. Transport files that are created by the XPORT engine can be transferred across operating environments and read using the XPORT engine with the DATA step or PROC COPY.

The process for creating a transport file at the source machine and reading it on a target machine follows :

  1. A transport file is created at the source machine using the XPORT engine with the DATA step or PROC COPY.

  2. The file is transferred from the source machine to the target machine.

  3. The transport file is read at the target machine using the XPORT engine with the DATA step or PROC COPY.

Note  

Transport files that are created using PROC CPORT are not interchangeable with transport files that are created using the XPORT engine.



XPORT Engine Advantages

Using the XPORT engine (with either the DATA step or the COPY procedure) provides the following advantages:

  • the ability to move files between operating environments, regardless of whether you are moving the transport file to a later or an earlier SAS release.

    Note  

    Regressing a data set (moving from a later release to an earlier release) eliminates the features that are specific to the later release. For example, when moving from SAS 9 to SAS 6, the long variable names in SAS 9 are truncated to 8 bytes. For details about file regression, see "Regressing SAS Data Sets to SAS 6 Format" on page 26.

  • You can use the XPORT engine when sending a transport file to a destination operating environment when the SAS release is unknown.

  • you can create the transport file one time and direct it to multiple target operating environments that run different SAS releases.

The primary reason for using the XPORT engine with the DATA step is to dynamically create one or more data sets, to order them, and then to translate them to transport format. By contrast, PROC COPY allows you to translate multiple data sets that already exist in a library.



XPORT Engine Limitations

Using the XPORT engine has the following limitations:

  • The XPORT engine supports only members of type DATA. It does not support members of type CATALOG or VIEW.

  • The XPORT engine supports a Version 6-compatible feature set. The XPORT engine cannot support SAS 9 features, such as long variable names . Warning or error messages report limitations that are encountered during the transport operation. For information about typical error messages and recovery actions, see "File library.member .DATA has too long a member name for the XPORT engine" on page 73.

  • The XPORT engine with PROC COPY does not support the transport of any type of view or MDDB.



Regressing SAS Data Sets to SAS 6 Format

The UPLOAD and DOWNLOAD procedures in SAS/CONNECT and PROC COPY with the XPORT engine are the only strategies available for regressing a data set to SAS 6.

Note  

SAS/CONNECT requires a separate license.

SAS 9 and 8 support of long variable names, long variable labels, and long data set labels can make SAS 9 and 8 data sets incompatible with SAS 6 data sets. In order to revert back to SAS 6, these long names must be truncated to a length that is supported in SAS 6. Here are the truncation rules:

SAS 9 and 8 Data Set Object Names to Regress

Truncates to x characters for SAS 6

Data set labels

40

Variable labels

40

Variable names

8

In order to transport SAS 9 and 8 files back to SAS 6, set the portable VALIDVARNAME system option to the value V6 in the SAS session in which you are transporting the file. Here are examples, which are specified in the form of a SAS system option and a macro variable:

options VALIDVARNAME=V6
%let VALIDVARNAME=V6;

For details about setting the VALIDVARNAME system option, see SAS Language Reference: Dictionary .

The truncation algorithm that is used to produce the 8-character variable name also resolves conflicting names:

  • The first name that is greater than 8 characters is truncated to 8 characters. A truncation from PROPERTYTAXRATE to PROPERTY is the first truncation.

  • The next name that is greater than 8 characters is truncated to 8 characters. If it conflicts with an existing variable name, it is truncated to 7 characters, and a suffix of 2 is added. For example, PROPERTYTAXRATE is truncated to PROPERT2.

  • The suffix is increased by 1 for each truncated name that conflicts with an existing name. If the suffix reaches 9, the next conflicting variable name is truncated to 6 characters, and a suffix of 10 is appended. For example, PROPERTYTAXRATE is truncated to PROPER10.

The VALIDVARNAME option solves the long variable name truncation problem. However, there are no techniques for regressing the following SAS 9 or 8 features to SAS 6:

  • Data set names that exceed 8 characters

  • Integrity constraints

  • Data set generations

  • Audit trail.

The solution to regressing data sets that have these features is to re-create the data sets without the SAS 9 or 8 features in a SAS 9 or 8 session.

Note  

SAS/CONNECT does support uploading or downloading some catalog entries from SAS 9 or 8 to SAS 6. For more information, see PROC UPLOAD and PROC DOWNLOAD in the SAS/CONNECT User's Guide .