Week 5 Flashcards
SAS INFORMANTS
Placed after variable name and ends with a .
Name $8. - 8 characters
DATE9.
Temp 5.1 - 5 width, 1 decimals
Used in a Format statement or in InPut line
Can do in data step or PROC print
User defined formats
PROC FORMAT;
VALUE var 0=‘no’
1=‘yes’;
RUN;
Best after the lib name statement
Then link the new format to the variable in a data step using informant
FORMAT var fmtvar.;
Used in. PROC step link is local only
PROC FORMAT
PROC FORMAT;
VALUE fmtname range-1= ‘text’;
VALUE $fmtname ‘text’ = ‘format text’;
To remove format, declare format in a VALUE statement, but don’t include ranges
DOLLARw.d - counts all characters
PERCENTw.d.
SSNw.
Zw.d leading zeros
How to create a permanent format?
LIBNAME SASDATA ‘c://‘;
PROC FORMAT LIBRARY = SASDATA;
VALUE etc;
Run;
How to use formats from the permanent library?
LIBNAME SASDATA “C://“;
OPTIONS FMTSEARCH = (Work. Formats library.formats);