Usage Note 37332: General information about storing and retrieving user-defined formats
SAS user-defined formats are stored independently from data sets. When creating a user-defined format, PROC FORMAT creates a format catalog named Formats in the Work library if one does not already exist. Otherwise, it updates the existing catalog. You can use the LIBRARY= (or LIB=) option to instruct PROC FORMAT to write the format to a permanent location.
Unlike elsewhere in SAS where the one-level name indicates a file in the Work library, a one-level name in the LIB= option indicates a library where you want to store the formats.
For example, in the below code, SAS will create a catalog named Formats in the directory defined as Library. The entry is named TESTFMT.
libname library 'c:\mySAS';
proc format lib=library;
value testfmt 1='yes'
2='no';
run;
How does SAS find my formats? SAS looks in the following locations for a catalog named Formats:
- the Work library
- the location defined by the libref Library
- the locations listed in the FMTSEARCH= system option.
The Work and Library librefs are always searched first unless they appear in the FMTSEARCH= system option. If Work and Library appear in the list, these locations will be searched in the order in which they are listed. Note that the FMTSEARCH= system option expects a libref, not a path. For example:
options fmtsearch=(test);
The catalog does not have to be named Formats. You can use the PROC FORMAT LIB= option to specify a two-level name, where the first level is the libref and the second level is the name of the format catalog. The code below creates the catalog Cat in the directory defined by the Test libref:
libname test 'c:\mySAS';
proc format lib=test.cat;
When you create a catalog named anything other than Formats, you will also need to specify a two-level name in the FMTSEARCH= option:
options fmtsearch=(test.cat);
In the sample code above, we have instructed SAS to look for formats in the catalog Cat in the Test library.
Operating System and Release Information
SAS System | Base SAS | Tru64 UNIX | | |
Solaris for x64 | | |
Solaris | | |
OpenVMS on HP Integrity | | |
OpenVMS Alpha | | |
Linux on Itanium | | |
Linux for x64 | | |
Linux | | |
IRIX | | |
HP-UX IPF | | |
HP-UX | | |
AIX | | |
ABI+ for Intel Architecture | | |
64-bit Enabled Solaris | | |
64-bit Enabled HP-UX | | |
64-bit Enabled AIX | | |
Windows Vista | | |
Windows Millennium Edition (Me) | | |
Microsoft Windows XP Professional | | |
Microsoft Windows Server 2008 | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 7 | | |
OS/2 | | |
Microsoft® Windows® for x64 | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
OpenVMS VAX | | |
z/OS | | |
*
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.
This note contains general information about storing and retrieving user-defined formats.
Type: | Usage Note |
Priority: | |
Topic: | Data Management ==> Manipulation and Transformation ==> User Written Formats
|
Date Modified: | 2009-10-13 10:11:46 |
Date Created: | 2009-10-03 16:30:26 |