标题: 两个小问题 [打印本页] 作者: shiyiming 时间: 2005-6-7 01:45 标题: 两个小问题 1. A raw data file is listed below.
son Frank 01/31/89
daughter June 12-25-87
brother Samuel 01/17/51
The following program is submitted using this file as input.
data work.family;
infile file-specification;
<insert INPUT statement here>
run;
Which INPUT statement correctly reads the values for the variable BIRTHDATE as SAS date values?
A. input relation $ first_name $ birthdate date9.;
B. input relation $ first_name $ birthdate mmddyy8.;
C. input relation $ first_name $ birthdate : date9.;
D. input relation $ first_name $ birthdate : mmddyy8.;
我在机器上试验, 以上四个选择都不行
2. The following SAS program is submitted:
data work.areacodes;
phonenumber = 3125551212;
code = '('!!substr(phonenumber,1,3)!!')';
run;
Which one of the following is the value of the variable CODE in the output data set?
A. ( 3)
B. (312)
C. 3
D. 312
机器试验的结果是A, 为什么?作者: shiyiming 时间: 2005-6-7 09:20 标题: 答案 第一个题的答案应该是D, 你可以加一句format来看output的效果.
data ahuige;
input relation $ first_name $ birthdate : mmddyy8.;
format birthdate mmddyy8.;
cards;
son Frank 01/31/89
daughter June 12-25-87
brother Samuel 01/17/51
;
run;