The most robust method available for migrating user-defined format libraries is PROC FORMAT with the CNTLOUT= and CNTLIN= options. With this method, all of the information needed to recreate a format library is written out to a SAS data set. The SAS data set is called a "control data set". The file is then transferred to the receiving site where the process is reversed and the format catalog is recreated using PROC FORMAT and the CNTLIN= option.
You can create a transport file (see Example One below) or a SAS data set (.sas7bdat) (see Example Two below) using PROC FORMAT, but you must be submitting the code where the catalog is native (in the system where the catalog was originally created) if you wish to avoid any errors. Then after moving the intermediary file in a BINARY format to the target operating system, you will be able to use PROC FORMAT and the CNTLIN= option to recreate the catalog in the target system.
The advantages of using PROC FORMAT to move format catalogs are as follows:
- The sending and receiving systems do not have to use the same character set. The formats are created anew using the information stored in the control data set; therefore, later uses of the formats will be done using a binary search.
- Your format catalog can be used in a different release or an earlier version of SAS.
- The target system can be running SAS in an entirely different operating system than the one in which the catalog was created.
The following example uses the XPORT engine to create a control data set in transport format. This method can be used to migrate a format catalog back to prior versions of SAS across operating systems beginning with SAS 6.03. (If you are using the XPORT transport format, you will need to make sure the format catalog does not have a name greater than eight characters or use value labels greater than 200). If this is not the case, use the code in Example Two below, instead.
Example One - Using PROC FORMAT CNTLOUT to create a transport file
libname library 'location-of-existing-formats-catalog';
libname trans xport 'transport-file-name';
proc format library=library cntlout=trans.cntlfmt;
|
Note:
CNTLFMT can be any valid SAS data set name. As with any transport file in SAS, the file must be created with the appropriate file attributes, when applicable, and the file must be moved using a BINARY or IMAGE transfer when being moved from site to site.
After moving the XPORT transport file to the receiving site, the following code is used to regenerate the format library:
libname library 'output-library-for-format-storage';
libname trans xport 'transport-file-name-from-sending-site';
proc format library=library cntlin=trans.cntlfmt;
|
Note:
CNTLFMT is the same name that was used with the CNTLOUT= option at data set
creation time.
Example Two - Using PROC FORMAT CNTLOUT to create a SAS data set
libname library 'location-of-existing-formats-catalog';
libname out 'path-to-directory';
proc format library=library cntlout=out.cntlfmt;
|
SAS will append the extension .sas7bdat to the output file. After moving the .sas7bdat file to the receiving site (make sure to specify a BINARY transfer), the following code is used to regenerate the format library. Note: CNTLFMTt is the same name that was used with the CNTLOUT= option at data set creation time.
libname library 'output-library-for-format-storage';
libname in 'data-set-name-from-sending-site';
proc format library=library cntlin=in.cntlfmt;
|
For more details regarding PROC FORMAT options, refer to the PROC FORMAT statement in the SAS Procedures Guide.
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.