Using SAS Files from Other Versions with SAS 9.1 for Windows


Introduction to Using SAS Files from Other Versions with SAS 9.1 for Windows

SAS files that were created in Versions 8, 7, and 6 can be processed , with some restrictions, without having to convert files to the SAS 9.1 format.

SAS 9.1 file formats are the same as Version 7 and 8 file formats with the exception that with SAS 9.1 you can use longer format and informat names . The following table summarizes the actions that you need to take in order to use SAS files from a previous release, if the files in the SAS library are for the same release of SAS.

Table 4.5: Summary of Using Version 6,7 and 8 Data Sets and Catalogs in SAS 9.1

Version or Release

Data Sets

Catalogs

Version 7 and 8

No action is necessary. SAS reads, updates, and writes to Version 7 and Version 8 data sets.

No action is necessary. SAS reads, updates, and writes to Version 7 and Version 8 catalogs.

Releases 6.08-6.12

In 32-bit environments, no action is necessary. SAS reads, updates, and writes to Version 6 data sets.

In 64-bit environments, the V6 engine is automatically detected . SAS can read a V6 data set but not write to a V6 data set.

Convert using the CPORT and CIMPORT procedures

Releases 6.04 and 6.03

Use the V604 engine to read data. You cannot write to Release6.04and6.03datasets.

not supported

As the table shows, except for Release 6.04 and Release 6.03 data sets, Version 6 (32-bit environments) and Version 7 and 8 data sets do not need to be converted to SAS 9.1 data sets in order for SAS 9.1 to read, update, and write to the data sets.

Version 7 and 8 catalogs also do not need to be converted to V9 catalogs. Version 6 SAS catalogs can only be read. If a Version 6 catalog is to be updated, you must convert it to a SAS 9.1 catalog.

'SAS 9.1 Compatibility with SAS Files From Earlier Releases' in SAS Language Reference: Concepts discusses in detail how to use or convert SAS files that were created in Release 6.08 through Version 8. See the SAS/CONNECT User's Guide for information about accessing Version 6 SAS files if you use Remote Library Services to access SAS files on a server.

To use SAS files that were created on an operating environment other than Windows, you will need to transport those files to the Windows environment. A separate document, Moving and Accessing SAS Files , discusses transporting files from one operating environment to another operating environment.

Using Release 6.08 through Release 8.2 Data Sets

If your SAS library contains SAS files from only a single release of SAS, such as Release 6.12 or Version 8, SAS automatically determines the appropriate engine to use for these SAS data sets. If your SAS files are in a mixed mode library that possibly contains SAS data sets from multiple releases, you must specify the engine parameter on the LIBNAME statement or the engine will default to V9.

For example, if you know that the 'c:\mydata' SAS library contains only Version 6 files, the following SAS statements print a Version 6 SAS data set that is named WINDATA.SALEFIGS created under Windows 95:

 libname windata 'c:\mydata';  proc print data=windata.salefigs;     title 'Sales Figures';  run; 

Where all SAS files in the library are Version 6 SAS files, you can omit the engine parameter because SAS automatically detects the V6 engine.

Using the same example, if you are unsure or if you know that the SAS library is a mixed mode library, you must specify the engine name in the LIBNAME statement to

 access the V6 files:  libname windata v6 'c:\mydata';  proc print data=windata.salefigs;     title 'Sales Figures';  run; 

Release 6.03 and Release 6.04 SAS files require a specific engine. For more information, see 'Using Release 6.03 and Release 6.04 SAS Data Sets' on page 137.

Using Release 6.03 and Release 6.04 SAS Data Sets

The V604 engine enables you to read from Release 6.03 and Release 6.04 SAS data sets directly from your SAS 9.1 session. (Remember that there is no difference between Release 6.04 and Release 6.03 SAS data sets.) This feature is useful when you have SAS data sets that you want to share between Release 6.04 for PCs and SAS 9.1 under Windows. The V604 engine is supported only for SAS data sets (member type DATA). For example, if you have a Release 6.04 SAS data set that is named MYLIB.FRUIT that you want to print, you can submit the following statements from a SAS 9.1 session:

 libname mylib v604 'c:\sas604';  proc print data=mylib.fruit;  run; 

Converting Release 6.08 through Release 6.12 SAS Data Sets

While access to Version 6 SAS data sets is quite easy when you use the V6 engine, you might want to consider converting your SAS data sets to the SAS 9.1 format if you access them often and do not need to read the files from Version 6 anymore. The data set format of SAS 9.1 is more efficient than the Version 6 format and there are new SAS 9.1 features that cannot be used unless the data sets are converted.

The following SAS statements use the COPY procedure to convert all the Release 6 SAS data sets in the V6DATA SAS data library to SAS 9.1 and to format and store the new data sets in the WINDATA library:

 libname v6data v6 'c:\mydata';  libname windata V9 'd:\newdata';  proc copy in=v6data out=windata;  run; 

Alternatively, you can use the DATA step to do the conversion, as in the following example. This technique works well if you want to convert only one or two data sets in a particular SAS data library.

 libname v604data v604 'c:\mydata';  libname windata V9 'd:\newdata';  data windata.eggplant;     set v604data.eggplant;  run; 

Note: Do not convert your Version 6 files to SAS 9.1 if you need to access the files from both versions.

Using Version 7 and 8 Catalogs in SAS 9.1

Because SAS 9.1 file formats are basically the same as Version 7 and 8 file formats, SAS 9.1 can read, update, and write to Version 7 and 8 catalogs without having to convert them to SAS 9.1 catalogs.

SAS running in a 64-bit Windows operating environments cannot read 32-bit catalogs.

Converting Version 6 SAS Catalogs in SAS 9.1

Because of the differences in the internal structures of the operating environments, you must use the CPORT and CIMPORT procedures to convert Version 6 SAS catalogs created under Windows to SAS 9.1 format before you can use the catalogs in your SAS 9.1 session under Windows. Follow these steps:

  1. Using the CPORT procedure in your Version 6 SAS session, create a transport file that contains the SAS catalog to be converted.

  2. Transfer the file (perhaps on a network or diskette) to a location that your SAS 9.1 session can read.

  3. Use the CIMPORT procedure from your SAS 9.1 session to read the transport file and create a converted SAS catalog.

For information about using the CPORT and CIMPORT procedures, see Moving and Accessing SAS Files and Base SAS Procedures Guide .

Converting Release 6.08 SAS Catalogs to SAS 9.1

If you are converting directly from Release 6.08 to SAS 9.1, you can use the CPORT procedure in Release 6.08 to create a transport file, and then use the SAS 9.1 CIMPORT procedure to convert the catalog to a SAS 9.1 catalog. However, the HSERVICE and TOOLBOX catalog entries are not portable if you use CPORT from a Release 6.08 session.

An alternative way to convert Release 6.08 catalogs is to use the C16PORT procedure that is provided in Release 6.10 through Release 6.12. SAS provided the C16PORT procedure to convert the 16-bit catalogs that were created with Release 6.08 under Windows to a 32-bit format that SAS can use. You can use the C16PORT procedure from within one of these earlier releases of SAS to create a catalog that can later be read by SAS 9.1. (The C16PORT procedure is not available in SAS 9.1.)

To follow to convert your SAS catalogs from Release 6.08 under Windows to SAS 9.1:

  1. While in your Release 6.10, Release 6.11, or Release 6.12 session, use the C16PORT procedure (described in the documentation for those releases) to create a transport file that contains the SAS catalog from Release 6.08.

  2. Transfer the file (perhaps on a network or by using binary FTP) to a location where SAS can read it.

  3. Use the CIMPORT procedure to read the transport file and create a converted SAS catalog.

If you want to convert a catalog that currently exists on another machine running Release 6.08 for Windows, you must first transfer the file (perhaps on a network or by using binary FTP) to a place where your SAS 9.1 session can read it.

The following example uses the C16PORT procedure in Release 6.12 to create a transport file from the INLIB.CAT catalog, then creates a Release 6.12 catalog (OUTLIB.CAT) using the CIMPORT procedure.

 /* Folder where catalog    */     /* 'cat.sc2' resides       */  libname inlib 'c:\cat608';     /* Folder where catalog    */     /* 'cat.sc8' will reside   */  libname outlib 'c:\cat612';  proc c16port file='transprt' c=inlib.cat;  run;  /* Move the transprt file to a location where SAS can read it */  /* Once the file is accessible, run the following procedure.  */  proc cimport infile='transprt' c=outlib.cat;  run; 

The Release 6.12 SAS catalog can now be read by SAS 9.1. For information about the CPORT and CIMPORT procedures, see Base SAS Procedures Guide and Moving and Accessing SAS Files .

Converting Release 6.03 and Release 6.04 SAS Catalogs to SAS 9.1

If you want to convert Release 6.04 SAS catalogs to their SAS 9.1 counterparts, see Moving and Accessing SAS Files.

Creating Release 6.08 through Release 6.12 Data Sets

You may need to create Release 6.08 through Release 6.12 data sets from your Windows SAS session. This is similar to reading Version 6 data sets in that you use the V6 engine. For example, the following SAS statements use the V6 engine to create a SAS data set named QTR1. The raw data are read from the external file associated with the fileref MYFILE.

 libname windata v6 'c:\mydata';  filename myfile 'c:\qtr1data.dat';  data windata.qtr1;     infile myfile;     input saledate amount;  run; 



SAS 9.1 Companion for Windows
SAS 9.1 Companion for Windows (2 Volumes)
ISBN: 1590472004
EAN: 2147483647
Year: 2004
Pages: 187

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net