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:
- Entire SAS libraries, including format catalogs, can be placed into a transport file in a single step.
- You can use the CAT= CPORT option to selectively migrate catalogs. In Windows 32-64bit migrations where only 32-bit catalogs require migration beginning with SAS® 9.3, this is particularly useful.
- The MEMTYPE=CAT option expands CPORT processing to include other types of catalogs, and the SELECT and EXCLUDE statements provide added flexibility.
- The format catalog can be stored as an operating system independent file and restored on any other operating system to a native catalog.
Note that a binary transfer must be specified when moving transport files using communications software such as FTP.
- By default, PROC CPORT adds one byte to short byte numeric variables. This is an advantage when the floating-point representation is different.
In mainframe environments, numerics are frequently defined with lengths less than eight to reduce space. If you take data from an operating system that can support a numeric length of two to an operating system whose smallest length can be only three, precision can be lost. The EXTENDSN=NO CIMPORT option can be used on the target environment to prevent the byte expansion. Not all issues of precision or magnitude inherent in numeric precision issues can be prevented but, in most cases, PROC CPORT produces a warning.
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(R) 9.4 Files, Second Edition
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.