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.
Tip
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;
set cert.cars;
format ...
Get SAS Certification Prep Guide, 5th 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.