Associating User-Defined Formats with Variables

How SAS Finds Format Catalogs

To use the GENDER, AGEGROUP, and $COL formats in a subsequent SAS session, you must assign the libref Formtlib again.
libname formtlib 'C:\Users\Student1\formats\lib'; 
SAS searches for the formats GENDER, AGEGROUP, and $COL in two libraries, in this order:
  • the temporary library referenced by the libref Work
  • a permanent library referenced by the libref Formtlib
SAS uses the first instance of a specified format that it finds.
You can delete formats using PROC CATALOG.

Assigning Formats to Variables

Just as with SAS formats, you associate a user-defined format with a variable in a FORMAT statement.
data work.carsurvey;
  format ...

Get SAS Certified Specialist Prep Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.