Converting Format Catalogs from Version 8 to Version 9

Version 8 of SAS is a 32-bit application, while version 9 is a 64-bit application, so format catalogs must be transported from one version to another.

If you have the syntax which creates the catalogs, just rerun the job using SAS version 9 to re-create the catalog in 64-bit format. If creating the catalogs is more complex, then you can convert the catalogs using PROC CPORT and PROC CIMPORT. First, create a transport file (e.g., transport1.sas) using version 8 with the following syntax:

transport1.sas:

  LIBNAME library '~/sasv8files' ;
  FILENAME outfile 'format.xpt' ;
  PROC CPORT CATALOG=library.formats FILE=outfile;

In this example, the version 8 catalog, called formats.sas7bcat, is stored in the directory sasv8files under the home directory. The file to be created will be called format.xpt. The CATALOG reference in PROC CPORT uses a two-part libref to access the permanent catalog formats.sas7bcat in the ~/sasfiles directory. The FILE reference uses the fileref outfile to create a file called format.xpt in SAS transport format.

Run this file with the sas82 command:


  sas82 transport1

This will generate an output file called format.xpt ;

Now, recreate the format library in version 9. If your old format library is called formats.sas7bcat and you want the new file to be called formats.sas7bcat and stored in the same directory as the version 8 file, you will need to rename the old file:


   mv formats.sas7bcat formats.sas7bcat.v8

Create a SAS syntax file with commands similar to the following:


transport2.sas:

  LIBNAME library '~/sasv9files' ;
  FILENAME infile 'format.xpt' ;
  PROC CIMPORT INFILE=infile CATALOG=library.formats ;

In this example, the libref library is again used as a temporary name for the directory where the version 9 catalog is to be stored, here as ~/sasv9files. The INFILE reference uses the fileref infile to access the format.xpt file for conversion. As with PROC CPORT, the CATALOG reference in PROC CPORT uses a two-part libref to create the permanent catalog formats.sas7bcat in the ~/sasv9files directory.