|
|
楼主

楼主 |
发表于 2007-10-5 12:14:17
|
只看该作者
求助关于 Data Step
Appreciate if any SAS experts could help with the following questions, many thanks
DATA _NULL_;
FILE PRINT;
INPUT ID $ 1-4 answers $ 6-10;
(SAS statements here)
DATALINES;
0123 ABCDE
2264 XCCBA
3124 aaBAD
1972 CBADE
9275 35AbE
6211 DDEAC
5278 A7344
;
a) Suppose the variable answers contains answers to 5 multiple choice problems in which legitimate answers are A, B, C, D, and E (upper case). Insert suitable SAS codes so that proper messages will be printed for each data line that contains invalid data. Be sure to include data line number for invalid data. Replace each of problematic answers with a question mark (?).
b) Suppose, in the above, the cases for the answers are ignored. That is, a, b, c, d, and e are legitimate answers corresponding to their upper-case counterparts. Redo part (a).
c) Suppose, in addition to part (b), the five numbers 1, 2, 3, 4, and 5 are also legitimate answers (1 for A, 2 for B, etc). Redo part (a). |
|