6.After a SAS program is submitted, the following is written to the SAS log:
101 data WORK.JANUARY;
102 set WORK.ALLYEAR(keep=product month num_Sold Cost);
103 if Month='Jan' then output WORK.JANUARY;
104 Sales=Cost * Num_Sold;
105 keep=Product Sales;
-----
22
ERROR 22-322: Syntax error, expecting one of the following: !,!!, &, *, **, +, -, , <=, <>, =, >, >=,
AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,NOTIN, OR, ^=, |, ||, ~=.
106 run;
What changes should be made to the KEEP statement to correct the errors in the LOG?
A. keep=(Product Sales);
B. keep Product, Sales;
C. keep=Product, Sales;
D. keep Product Sales;
Answer: D
怎么觉得D也有问题呢?不应该是Keep=Product Sales吗?
-------------------------------------
17.Given the following data step:
data WORK.GEO;
infile datalines;
input City $20.;
if City='Tulsa' then
State='OK';
Region='Central';
if City='Los Angeles' then
State='CA';
Region='Western';
datalines;
Tulsa
Los Angeles
Bangor
;
run;
After data step execution, what will data set WORK.GEO contain?
A.
City State Region
----------- ----- -------
Tulsa OK Western
Los Angeles CA Western
Bangor Western
B.
City State Region
----------- ----- -------
Tulsa OK Western
Los Angeles CA Western
Bangor
C.
City State Region
----------- ----- -------
Tulsa OK Central
Los Angeles CA Western
Bangor Western
D.
City State Region
----------- ----- -------
Tulsa OK Central
Los CA Western
Bangor
Answer: A
-------------------------------------
为什么不是选D啊?解体思路到底是怎样的啊?
求强人解答啊!谢谢了先!