p***7 发帖数: 535 | 1 proc format;
value score 370 - 670 = '670-'
671 - 870 = '671+'
other = 'unscored'
;
proc freq data=score;
table score;
format score score.;
run;
in the output window the ‘unscored’ label appears without truncation.
Because when assigning a character label in a
dataset, the length of the first evaluation of the
label will be applied to all labels.
I don't understand it,what does the first evaluation mean here? for me
the length of '670-' is shorter than 'unscored'. |
a****g 发帖数: 8131 | 2 does format have the same length requirement as variable names?
【在 p***7 的大作中提到】 : proc format; : value score 370 - 670 = '670-' : 671 - 870 = '671+' : other = 'unscored' : ; : proc freq data=score; : table score; : format score score.; : run; : in the output window the ‘unscored’ label appears without truncation.
|
p***7 发帖数: 535 | 3 No. If you use 'if then' you will get truncated 'unsco' for unscore.
But format will allow the full length 'unscore'.
I don't understand the reason. |
p***7 发帖数: 535 | |
S******6 发帖数: 752 | 5 I think you misunderstand the lecture.
It should be "
When assigning a character label in a
dataset, the length of the first evaluation of the
label will be applied to all labels."
However, if you use the proc format, their is no truncation problem now. |