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 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;
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;
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.
|Product Family||Product||System||SAS Release|
|SAS System||Base SAS||All||n/a|
|Topic:||SAS Reference ==> Procedures ==> FORMAT|
|Date Modified:||2011-07-12 16:01:47|
|Date Created:||2002-12-16 10:56:34|