l******5 发帖数: 176 | 1 data work.family;
infile 'file-specification';
input @1 date_of_birth mmddyy10.
@15 first_name $5.
@25 age 3;
run;
我知道答案,但是不明白真正的原因,那位大牛给解惑一下,谢谢。我试着把age 3.改
为age 2, age 1, age 12, 最后得到的age值都不一样。 | t********o 发帖数: 369 | 2 try to answer your question.
3 overwrites @25, and age 3 means to read age at column 3, so after reading
dateofbirth, name, the pointer goes back to column 3 and read only that
column for age.
At column 3, there is no value for age but a "/", so age value is missing.
you can try put age 1, you will get the first column value for age (0,1,0
for each obs),
age 2, 1,2,1 for each obs;
age 3, no value,
age 4, 0,2,0 and so on. | l******5 发帖数: 176 | 3 You are so smart. Thanks.
reading
【在 t********o 的大作中提到】 : try to answer your question. : 3 overwrites @25, and age 3 means to read age at column 3, so after reading : dateofbirth, name, the pointer goes back to column 3 and read only that : column for age. : At column 3, there is no value for age but a "/", so age value is missing. : you can try put age 1, you will get the first column value for age (0,1,0 : for each obs), : age 2, 1,2,1 for each obs; : age 3, no value, : age 4, 0,2,0 and so on.
| t********o 发帖数: 369 | 4 that's very encouraging since I am old.good luck with sas exam! |
|