Associating User-Defined Formats with Variables

Referencing Your Formats

Remember that permanent, user-defined formats are stored in a format catalog. For example, the program below stores the format JOBFMT in a catalog named Library.Formats, which is located in the directory C:\Sas\Formats\Lib in the Windows environment.
libname library 'c:\sas\formats\lib'; 
proc format lib=library; 
   value jobfmt 
         103='manager' 
         105='text processor' 
         111='assoc. technical writer' 
         112='technical writer' 
         113='senior technical writer'; 
run;
To use the JOBFMT format in a subsequent SAS session, you must assign the libref Library again.
libname library 'c:\sas\formats\lib'; 
SAS searches for the format JOBFMT in two libraries, in this order:
  • the temporary ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.