由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - question about SAS BASE 123 NO.110
相关主题
base 123题第109题新的疑惑sas读入数据时的一个问题请教
##问一个SAS BASE 问题##请教SAS base 123 一题
Base sasOne question about data step in sas
请问base(123题)的第114题请教SAS问题:这个code有什么办法简化吗?
急请教 sas base 123 109-110题SAS 问题请教
SAS BASE Questions[合集] SAS data input help
请问一道SAS BASE的题目,THANKS~~~请教一个SAS数据input的问题
sas base 70 key -errors[合集] 请教一个SAS数据input的问题
相关话题的讨论汇总
话题: ruth话题: idnum话题: employee话题: name话题: input
进入Statistics版参与讨论
1 (共1页)
w********y
发帖数: 371
1
Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
The following SAS program is submitted:
data test;
infile 'employee';
input employee_name $1-4;
if employee_name='Ruth' then input idnum 10-11;
else input age 7-8;
run;
Which one of the following values does the variable IDNUM contain when the
name of the employee is "Ruth"?
A.11
B.22
C.32
D. .(missing numeric value)
The answer is B.
I run this code:
data test;
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
put employee_name= idnum= age=;
cards;
Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
;
run;
And I get the log message:
employee_name=Ruth idnum=22 age=.
employee_name=Sue idnum=. age=40
Can someone help me figure out the procedure? Thank you!
v********9
发帖数: 35
2
read Ruth in first record as employ_name and then jump to the second record
and read 22 to idnum. Put the defult value . to age. It uses two records to
to input one observation.
If add the sign @ followed by "input employee_name $ 1-4;", you will get
four observations.
1 (共1页)
进入Statistics版参与讨论
相关主题
[合集] 请教一个SAS数据input的问题急请教 sas base 123 109-110题
SAS数据输入疑问SAS BASE Questions
请教Base 70 中的一题 关于@请问一道SAS BASE的题目,THANKS~~~
用SAS生成CSV 文件sas base 70 key -errors
base 123题第109题新的疑惑sas读入数据时的一个问题请教
##问一个SAS BASE 问题##请教SAS base 123 一题
Base sasOne question about data step in sas
请问base(123题)的第114题请教SAS问题:这个code有什么办法简化吗?
相关话题的讨论汇总
话题: ruth话题: idnum话题: employee话题: name话题: input