t****y 发帖数: 576 | 1 看到的答案是A,但实际运行结果state一栏全是empty value,想是因为city被drop,影响
了if statement. 这样一来根本就没有正确答案。
48.The following SAS program is submitted:
data WORK.TEST;
drop City;
infile datalines;
input
Name $ 1-14 /
Address $ 1-14 /
City $ 1-12 ;
if City='New York ' then input @1 State $2.;
else input;
datalines;
Joe Conley
123 Main St.
Janesville
WI
Jane Ngyuen
555 Alpha Ave.
New York
NY
Jennifer Jason
666 Mt. Diablo
Eureka
CA
;
What will the data set WORK.TEST contain?
A.
Name Address State
-------------- ---------------- ------
Joe Conley 123 Main St.
Jane Ngyuen 555 Alpha Ave. NY
Jennifer Jason 666 Mt. Diablo
B.
Name Address City State
-------------- ---------------- ----------- ------
Joe Conley 123 Main St. Janesville
Jane Ngyuen 555 Alpha Ave. New York NY
Jennifer Jason 666 Mt. Diablo Eureka
C.
Name Address State
-------------- ---------------- ------
Jane Ngyuen 555 Alpha Ave. NY
D. O observations,there is a syntax error in the data step. |
s******0 发帖数: 1269 | 2 如果让我选会选c,但是没见过input后面没东西的 |
s******0 发帖数: 1269 | 3 如果让我选会选c,但是没见过input后面没东西的 |
p**3 发帖数: 2 | 4 "The answer is A" is correct ! Try removing and re-typing the datalines data
(no indenting) after copying and pasting. Run again and see what happens.
【在 t****y 的大作中提到】 : 看到的答案是A,但实际运行结果state一栏全是empty value,想是因为city被drop,影响 : 了if statement. 这样一来根本就没有正确答案。 : 48.The following SAS program is submitted: : data WORK.TEST; : drop City; : infile datalines; : input : Name $ 1-14 / : Address $ 1-14 / : City $ 1-12 ;
|
p*****1 发帖数: 21 | 5 选A。没有syntax error, 所以可以直接excute。if...then...条件true,就不执行下一
个else,只有当if...then false了,进行else if 判定,然后input后面没有variable
。 |
t****y 发帖数: 576 | 6 you are right. Thx!
data
【在 p**3 的大作中提到】 : "The answer is A" is correct ! Try removing and re-typing the datalines data : (no indenting) after copying and pasting. Run again and see what happens.
|