How to use the CPORT procedure to move formats from one platform (operating environment) to another


The CPORT procedure has the ability to place SAS® format catalogs into a portable file for migration to other operating environments. The PROC CIMPORT statement implicitly translates the transport file into the target computer's native format.

The advantages of using this method are:

Restriction

The method is only upwardly compatible. This means that the receiving operating environment must be running a release of SAS that is equal to or higher than the release used to create the transport file. This method should be used only when it is known that the receiving site is at or above the sending site's release of SAS.

 

The following example shows how to create a transport file using PROC CPORT:

 libname yourlib 'location-of-existing-formats-catalog';

filename trans 'transport-file-name';

/* Code to process the formats catalog only. */
proc cport catalog=yourlib.formats file=trans;

OR

/* Code to process entire SAS library, including formats catalog. */
proc cport library=yourlib file=trans;
 

The following example shows how to use PROC CIMPORT to read a transport file that was created by PROC CPORT:

/* Code to read in any file created by PROC CPORT. */

libname yourlib 'output-library-for-proc-cimport';
filename trans 'transport-file-from-other-site';

proc cimport library=yourlib infile=trans; 

The output library should contain all of the members that existed in the PROC CPORT transport file.

Special notes for mainframe users such as z/OS

When a transport file is created on the mainframe, the appropriate file attributes must be used in a FILENAME statement or in the JCL.

LRECL=80 RECFM=FB BLKSIZE=8000       

Sample JCL for creating a transport file on the mainframe

//XPORTOUT DD DSN=userid.XPORTOUT.DAT, DISP=(NEW,CATLG,DELETE),
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),
//            SPACE=(TRK,(1,1))
//SYSIN    DD *

It is always recommended that you verify that the transport file attributes are correct and that the transport file can be imported on the mainframe before you send it to a receiving environment. Communications software can be used to move the file with a BINARY transfer or if you are using menu-driven FTP software, make sure that the BINARY mode is checked.

Start here to read more about the CPORT and CIMPORT procedures: Moving and Accessing SAS® 9.4 Files, Second Edition