As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.
Here are some tips for How to share your SAS knowledge with your professional network.
The FORMAT procedure can be used to create user defined formats and informats, as well as list the format specification or write it to an output dataset.
- PROC FORMAT <options> ;
- <Zero or more format statements>
- QUIT ;
- SELECT statement
- VALUE statement
You can create a shared user defined format if you specify the library APFMTLIB as the destination library in the FORMAT procedure. After the procedure runs the formats will be available to other SAS users that share the same SAS environment.
The FMTLIB option of the FORMAT procedure allows you to list all the values included in the format library. The code:
PROC FORMAT LIBRARY=APFMTLIB.FORMATS FMTLIB; QUIT;
will produce a listing of each value range in a format and what that range translates into when the format is applied.
But if you just want a list of the format names, use the CATALOG procedure instead. This code:
PROC CATALOG CATALOG=APFMTLIB.FORMATS ; CONTENTS; RUN; QUIT;
will list the names and types of all the formats and informats in the APFMTLIB format catalog.
Deleting a format
NOTE: You cannot use the FORMAT procedure to delete a format or informat.
If you want to delete a format or informat then you need to use the CATALOG procedure and delete the entry from the FORMAT catalog associated with the LIBRARY specified in the FORMAT procedure. This code
PROC CATALOG CATALOG=APFMTLIB.FORMATS ; DELETE BAD_FMT; RUN; QUIT;
will delete the format entry called BAD_FMT from the APFMTLIB format catalog.