Usage Note 23007: How can I permanently store and use formats that I have created?
For the purpose of this discussion, formats and informats are referred to as
formats.
To permanently store a SAS® format so that it can be used in subsequent SAS sessions, you need to use the LIB= option on the PROC FORMAT statement.
This option specifies the library, catalog name, or both, that will contain the
format catalog. If the catalog name is omitted, then by default the format
catalog will be named FORMATS.
LIBNAME libref 'path-to-the-format-library';
PROC FORMAT LIB=libref<.catalog-name>;
Once the formats are permanently stored in a catalog, in order to use them, SAS
will need to know where to find them. This is accomplished in two ways.
- By default, SAS will always look in a library referenced by the LIBRARY
libref for a format catalog. This method is to be used when there is only one
format library and/or the format catalog name is FORMATS.
- If you have multiple format libraries, format catalogs named something
other than FORMATS or if you wish to specify the order in which format catalogs
are searched for a format, you will need to use the FMTSEARCH= option.
OPTIONS FMTSEARCH=(catalog-specification-1... catalog-specification-n);
This option searches format catalogs in the order listed, until the desired
member is found. The value of libref can be either libref or libref.catalog. If
only the libref is given, SAS assumes that FORMATS is the catalog name.
The WORK.FORMATS catalog is always searched first, and the
LIBRARY.FORMATS catalog is searched next, unless one of them appears in the
FMTSEARCH= list. If a catalog appears in the FMTSEARCH= list, the catalog
is searched in the order in which it appears in the list. If a catalog in the
list does not exist, that particular item is ignored and searching continues.
To keep from having to list these options each time you invoke SAS, they can be
placed in the AUTOEXEC.SAS file. This file contains SAS statements that are
executed automatically when you invoke the SAS System or when you start another
SAS process. The autoexec file can contain any valid SAS statements. For more
information on this file, refer to your system documentation.
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.
| Type: | Usage Note |
| Priority: | low |
| Topic: | SAS Reference ==> Procedures ==> FORMAT
|
| Date Modified: | 2007-11-06 11:00:36 |
| Date Created: | 2002-12-16 10:56:34 |