FOCUS AREAS

Hot Topics

Related Links

Compatibility

Migration

Using a SAS File in a Previous Release


Introduction

Before reading this topic, be aware that a few new SAS file features are not supported under previous releases. In addition, changes and enhancements in SAS software can cause differences in processing.

SAS®9 users can share SAS files with users of prior releases, but the methods differ according to the circumstances. In some cases, the processing is transparent, and the file can be used as-is with no extra steps. This is an example of compatibility. If compatibility does not meet your needs, you might be able to change the file to the format of the previous version, which is known as regressing. This document provides information about compatibility as well as instructions, limitations, and requirements for several methods of regressing.

In addition to the methods presented here, if you have SAS/CONNECT or SAS/SHARE licensed, you can always use Remote Library Services in SAS/CONNECT or SAS/SHARE, or Data Transfer Services (DTS) in SAS/CONNECT.

Note

Do not use PROC CPORT and PROC CIMPORT for regressing. You will experience numerous errors trying to import the transport file. Common errors include the following:

     ERROR: TRANSPORT FILE IS BAD
     ERROR: The value is not a valid SAS name

While the CPORT transport file enables SAS users to share SAS data files between operating environments, it was designed to support the newest features of SAS. As such, it renders the data unusable to prior releases. For more information, see the topic about using PROC CPORT and PROC CIMPORT in Moving and Accessing SAS Files in the SAS online documentation.


Using a SAS®9 Data File under SAS 7 or 8

First Try Compatibility in SAS 7 or 8

Because compatibility requires no extra steps, it's usually preferred to regressing. Use the Compatibility Calculator to determine whether you have adequate compatibility. Remember that a SAS®9 file has the the same file extension (for example, SAS7BDAT) and virtually the same file format as a SAS 7 or 8 file.

Regressing to SAS 7 or 8

You cannot simply use the V8 engine for regressing of SAS®9 files. Nor can you use PROC CPORT and PROC CIMPORT for SAS data files (SAS catalogs have no known issues). The following table summarizes supported methods and their limitations.

Methods of Regressing a SAS®9 File to SAS 7 or 8
Method Limitations
PROC COPY with the NOCLONE option Must be run in the SAS 7 or 8 session
DATA step Must be run in the SAS 7 or 8 session
XPORT engine Truncates variable names to eight characters
OUTREP=  

Using PROC COPY and NOCLONE for Regressing to SAS 7 or 8

In a SAS 7 or 8 session, you can use PROC COPY with the NOCLONE option to copy a foreign file to a native SAS data file. Here is some example code.

   libname intest 'pathname-of-foreign-file';
   libname outtest 'pathname-for-new-native-file';
   proc copy in=intest out=outtest noclone;
      /* Use the SELECT statement to specify a single data set */
      select my-data-set;
   run;

Using the DATA Step for Regressing to SAS 7 or 8

In a SAS 7 or 8 session, if you submit a DATA step like the following example, the new data set is created in the native data representation of the current operating environment:

   libname intest 'pathname-of-foreign-file';
   libname outtest 'pathname-for-new-native-file';
   data outtest.native-filename;
      set intest.foreign-filename;
   run;

Using the XPORT Engine for Regressing to SAS 7 or 8

The XPORT engine enables portability across operating environments and between versions. You can create a transport file in a SAS®9 session and restore it in a SAS 6, 7, or 8 session.

The XPORT engine supports some Version 5 naming restrictions: variable names with 8 characters or fewer and labels with up to 40 characters. If your data file does not conform to these specifications, then you must specify the system option VALIDVARNAME=V6, which truncates the names and labels according to the algorithm documented in Moving and Accessing SAS Files. See that documentation for full syntax and usage.

   options validvarname=v6

Here is an example of code you run in the SAS®9 session:

   libname source 'pathname-of-v9-file';

   /* Give the transport file a name and extension */
   /* In this case, the transport file is c:\mySAS\filename.stx */

   libname xportout xport 'c:\mySAS\filename.stx';
   proc copy in=source out=xportout;
     /* Use the SELECT statement to specify a single data set */
     select my-data-set;
   run;

And this is an example of code you run in the SAS 7 or 8 session:

   libname xportin xport 'c:\mySAS\filename.stx';
   libname target 'pathname-for-v8-file';
   proc copy in=xportin out=target;
   run;

Do not use the DATECOPY option with PROC COPY in this method; see SAS Note 13224.

Using the OUTREP= Option for Regressing to SAS 7 or 8

If you want to avoid a performance loss from CEDA processing and cannot use the XPORT engine due to its variable truncation, here is another alternative. You can create the file in SAS®9 with the desired SAS 8 native data representation. The new OUTREP= data set and LIBNAME option creates a SAS data set with the data representation of another operating environment.

For a list of the OUTREP= values that you can specify in a DATA step or in a LIBNAME statement, see the OUTREP= data set option in SAS Data Set Options: Reference, or the OUTREP= option for the LIBNAME statement in SAS Global Statements: Reference.


Regressing a SAS®9 Data File to SAS 6

SAS®9 data files cannot be used in SAS 6 without regressing to SAS 6 format. Use the table below to determine which method to use.

Methods of Regressing a SAS®9 File to SAS 6
Method Limitations
DATA step with the V6 engine SAS®9 and SAS 6 must be on the same operating environment.
PROC COPY with the V6 engine Set VALIDVARNAME=V6 before the PROC COPY.
SAS®9 and SAS 6 must be on the same operating environment.
XPORT engine  

In addition, if SAS/CONNECT is licensed, you can use PROC UPLOAD and PROC DOWNLOAD to regress a file.

Using the DATA Step with the V6 Engine for Regressing to SAS 6

Here is an example of regressing an existing SAS®9 file to Version 6 by using the V6 engine. SAS®9 and SAS 6 must be on the same operating environment. In other words, you can only create a SAS 6 file for the platform you are running SAS®9 on. The two operating environments must both be 32-bit or both be 64-bit.

   libname v9lib 'pathname-of-v9-file';
   libname v6lib v6 'pathname-for-v6-file';
   data v6lib.v6-filename;
      set v9lib.v9-filename;
   run;

Using PROC COPY with the V6 Engine for Regressing to SAS 6

Here is an example of regressing using PROC COPY. SAS®9 and SAS 6 must be on the same operating environment. In other words, you can only create a SAS 6 file for the operating environment you are running SAS®9 on. The two platforms must both be 32-bit or both be 64-bit.

By default, the V6 engine automatically uses VALIDFMTNAME=FAIL processing, which produces an error message if you use a format or informat name longer than eight characters.

   libname v9lib v9 'pathname-of-v9-file';
   libname v6lib v6 'pathname-of-v6-file';

   options validvarname=v6;

   proc copy in=v9lib out=v6lib;
      /* Use the SELECT statement to specify a single data set */
      select my-data-set;
   run;

Using the XPORT Engine for Regressing to SAS 6

The XPORT engine enables portability across operating environments and between versions. See the information above in the section about using XPORT for regressing to SAS 7 or 8.


Further Reading in the SAS Online Documentation