
196 Handbook of SAS
®
DATA Step Programming
TABLE10.1
Examples of Value-or-Range Sets
Example
All Possible
Values Value-or-Range Values Being Labeled
1 2, 3, 4, 5, 6, 7, 8,
and 9
3, 5, 7, 9 = 'odd'
2, 4, 6, 8 = 'even'
3, 5, 7, and 9 are labeled with
‘odd’
2, 4, 6, and 8 are labeled with
‘even’
2 ‘A’, ‘B’, ‘C’, ‘D’,
and‘E’
'A', 'C', 'E'
='grp1'
'B', 'D' = 'grp2'
‘A’, ‘C’, and ‘E’ are labeled with
‘grp1’
‘B’ and ‘D’ are labeled with
‘grp2’
3 2, 3, 4, 5, 6, 7, 8,
and 9
2<−<6 = 'low'
6−<9 = 'high'
3, 4, and 5 are labeled with ‘low’
6, 7, and 8 are labeled with
‘high’
2 and 9 will be printed as 2 and
9 without any labels
4 2, 3, 4, 5, 6, 7, 8,
and 9
2-6 = 'low'
6-9 ...