SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 685|回复: 0
打印 上一主题 下一主题

求助关于 Data Step

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 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).
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-4 10:35 , Processed in 0.218746 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表