Syntax, VALUE statement:
VALUE format-name
range1='label1'
range2='label2'
...more
format-names...;
Tip:If you are running a version
of SAS before SASĀ®9,
the format name must be a SAS name up to eight characters long and
cannot end in a number.
|
proc format; value gender 1 = 'Male' 2 = 'Female'; value agegroup 13 -< 20 = 'Teen' 20 -< 65 = 'Adult' 65 - HIGH = 'Senior'; value $col 'W' = 'Moon White' 'B' = 'Sky Blue' 'Y' = 'Sunburst Yellow' 'G' = 'Rain Cloud Gray'; run;
S
'
A
'-'M
'
B
',
'D
', 'F
'.
These values can be character values or numeric values, but not a
combination of character and numeric values (because formats themselves
are either character or numeric).
proc format lib=library; value $grade 'A'='Good' 'B'-'D'='Fair' 'F'='Poor' 'I','U'='See Instructor'; run;
proc format lib=library; value agefmt 0-<13='child' 13-<20='teenager' 20-<65='adult' 65-100='senior citizen'; run;
proc format lib=library; value agefmt low-<13='child' 13-<20='teenager' 20-<65='adult' 65-high='senior citizen' other='unknown'; run;
000='employee''s jobtitle unknown';
proc format; value gender 1 = 'Male' 2 = 'Female'; value agegroup 13 -< 20 = 'Teen' 20 -< 65 = 'Adult' 65 - HIGH = 'Senior'; value $col 'W' = 'Moon White' 'B' = 'Sky Blue' 'Y' = 'Sunburst Yellow' 'G' = 'Rain Cloud Gray'; run;
146 proc format; 147 value gender 1 = 'Male' 148 2 = 'Female'; NOTE: Format GENDER is already on the library WORK.FORMATS. NOTE: Format GENDER has been output. 149 value agegroup 13 -< 20 = 'Teen' 150 20 -< 65 = 'Adult' 151 65 - HIGH = 'Senior'; NOTE: Format AGEGROUP is already on the library WORK.FORMATS. NOTE: Format AGEGROUP has been output. 152 value $col 'W' = 'Moon White' 153 'B' = 'Sky Blue' 154 'Y' = 'Sunburst Yellow' 155 'G' = 'Rain Cloud Gray'; NOTE: Format $COL is already on the library WORK.FORMATS. NOTE: Format $COL has been output.