Chapter Contents

Previous

Next
SAS Companion for the OS/2 Environment

Using SAS Files from Other Releases with Version 8 for OS/2

This section discusses using SAS files from previous releases of SAS for OS/2. For information about transporting files from other operating environments to the Windows environment, see Moving and Accessing SAS Files across Operating Environments.

If you intend to use Version 6 or 7 SAS files only with Version 8, you will see improved performance if you convert your earlier files to Version 8 files.

Note:   If you will be using your SAS files only with previous releases of the SAS System, do not convert your files to Version 8 files.   [cautionend]

Migrating Existing SAS Files to Version 8 summarizes the steps that you must complete to use your existing SAS data sets and catalogs with Version 8.

Migrating Existing SAS Files to Version 8
Release SAS Data Sets SAS Catalogs
6.12 for OS/2 Transparent CPORT and

CIMPORT

6.11 for OS/2 Transparent CPORT and

CIMPORT

6.10 for OS/2 Transparent CPORT and

CIMPORT

6.08 for OS/2 Transparent CPORT and

CIMPORT

6.06 for OS/2 V606 engine CPORT (C16PORT) and CIMPORT
6.03 and 6.04 V604 engine CPORT and CIMPORT

As the table shows, you can use SAS data sets that were created starting with Release 6.06 without first converting them. All Version 6 SAS catalogs must be transported to be used in Version 8.

Note:   Version 8 of SAS under OS/2 does not read SAS data sets under Windows directly as it did in Version 6. To use SAS data sets under Windows in the OS/2 operating environment, you must either transport them or use Cross Environment Data Access (CEDA). For more information, see Moving and Accessing SAS Files across Operating Environments.  [cautionend]


Using Version 6 SAS Data Sets in Version 8

This section discusses the use of SAS data sets that were created using Releases 6.06 through 6.12.

Using Release 6.08 through Release 6.12 Data Sets

If your SAS library contains only Version 6 SAS files, Version 8 automatically determines the appropriate engine to use for Release 6.08 and later SAS data sets. If your SAS files are in a mixed-mode library that possibly contains SAS data sets from Version 6 and Version 8, you must specify the engine parameter in the LIBNAME statement or else the engine defaults to V8.

For example, if you know that the 'c:\mydata' SAS library contains only Version 6 files, submit the following SAS statements to print a Version 6 SAS data set that is named OS2DATA.SALEFIGS:

libname os2data 'c:\mydata';
proc print data=os2data.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;

Using Release 6.03 and Release 6.04 SAS Data Sets

The V604 engine enables you to read from and write to Release 6.03 and Release 6.04 SAS data sets directly from your Version 8 SAS 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 Version 8 under Windows. The V604 engine is supported only for SAS data sets (member type DATA). For example, if you want to print a Release 6.04 SAS data set that is named MYLIB.FRUIT, submit the following statements from a Version 8 session:

libname mylib v604 'c:\sas604';
proc print data=mylib.fruit;
run;
While it is useful to be able to access SAS data sets that were created in a previous release of the SAS System, you cannot take advantage of the full functionality of the Version 8, which includes creating indexes and database views, unless you convert the data sets that were created with earlier releases of the SAS System to Version 8 data sets.

Converting Version 6 SAS Data Sets

While access to Version 6 SAS data sets is quite easy when you use the V6 engines, you may want to consider converting your SAS files to Version 8 format if you access them often and no longer need to read the files from Release 6. The data set format of Version 8 is more efficient than the Version 6 format, and there are new Version 8 features that cannot be used unless the data sets are converted.

The following SAS statements use the COPY procedure to convert all the Version 6 SAS data sets in the OS2DATA SAS data library to Version 8 and to format and store the new data sets in the OS2DATA8 library:

libname os2data v6 'c:\mydata';
libname os2data8 V8 'd:\newdata';
proc copy in=os2data out=os2data8 memtype=data;
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 os2data v608 'c:\mydata';
libname os2data8 V8 'd:\newdata';
data os2data8.eggplant;
   set os2data.eggplant;
run;

You can also use the CPORT and CIMPORT procedures to perform the conversion. Remember that when you convert a data set to Version 8 format, you can no longer read that data set from Version 6.

Note:   Do not convert your Version 6 files to Version 8 if you need to access the files from both versions.  [cautionend]

Creating Version 6 Data Sets

You may need to create Version 6 SAS 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 that is named QTR1. The raw data are read from the external file that is associated with the fileref MYFILE.

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


Converting Version 6 SAS Catalogs in Version 8

Differences exist in the internal structures of the operating environments. Therefore, you must use the CPORT and CIMPORT procedures to convert Version 6 SAS catalogs that were created under OS/2 to Version 8 format before you can use the catalogs in your Version 8 SAS session under OS/2. Here are the steps to follow:

  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 place that your Version 8 SAS session can read it.

  3. Use the CIMPORT procedure from your Version 8 SAS 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 across Operating Environments and SAS Procedures Guide.

Converting Release 6.06 SAS Catalogs

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

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

Here are the steps to follow to convert your SAS catalogs from Release 6.06 under Windows to Version 8:

  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.06.

  2. Use the CIMPORT procedure from your Release 6.10, Release 6.11, or Release 6.12 SAS session to read the transport file and create a converted SAS catalog.

  3. Use a Version 8 SAS session to access the converted catalog.

If you want to convert a catalog that currently exists on another machine running Release 6.06 for OS/2, you must first transfer the file (perhaps on a network or a diskette) to a place where your Version 8 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) by using the CIMPORT procedure.

   /* Folder where catalog    */
   /* 'cat.sc2' resides       */
libname inlib 'c:\cat606'; 
   /* Folder  where catalog   */
   /* 'cat.sc8' will reside   */
libname outlib 'c:\cat612'; 
proc c16port file='transprt' c=inlib.cat;
run;
proc cimport infile='transprt' c=outlib.cat;
run;

The Release 6.12 SAS catalog can now be read by Version 8. For information about the CPORT and CIMPORT procedures, see SAS Procedures Guide and Moving and Accessing SAS Files across Operating Environments.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.