What output is produced if April 15, 2000 falls on a Saturday? A. Obs newdate qdate ddate 1 APR152000 2 6
B. Obs newdate qdate ddate 1 04/15/2000 2 6
C. Obs newdate qdate ddate 1 APR152000 2 7
D. Obs newdate qdate ddate 1 04/15/2000 2 7 92
The following SAS program is submitted: data work.report; set work.sales_info; if qtr(sales_date) ge 3; run;
The SAS data set WORK.SALES_INFO has one observation for each month in the year 2000 and the variable SALES_DATE which
contains a SAS date value for each of the twelve months.
How many of the original twelve observations in WORK.SALES_INFO are written to the WORK.REPORT data set? A. 2 B. 3 C. 6 D. 9 93
The following SAS program is submitted: data revenue; set year_1;
var1 = mdy(1,15,1960); run;
Which one of the following values does the variable named VAR1 contain? A. 14 B. 15
C. 1151960 D. '1/15/1960' 94
The following SAS program is submitted: data work.new; mon = 3; day = 23; year = 2000;
36
date = mdy(mon,day,year); run;
Which one of the following is the value of the DATE variable? A. a character string with the value '23mar2000' B. a character string with the value '03/23/2000'
C. a numeric value of 14692, which represents the SAS date value for March 23, 2000 D. a numeric value of 3232000, which represents the SAS date value for March 23, 2000 95
The following SAS DATA step executes on Monday, April 25, 2000: data newstaff; set staff;
start_date = today(); run;
Which one of the following is the value of the variable START_DATE in the output data set? A. a character string with the value '04/25/2000'
B. a character string with the value 'Monday, April 25, 2000'
C. the numeric value 14725, representing the SAS date for April 25, 2000 D. the numeric value 04252000, representing the SAS date for April 25, 2000 96
The following SAS DATA step is submitted: data sasdata.atlanta sasdata.boston work.portland work.phoenix;
set company.prdsales;
if region = 'NE' then output boston; if region = 'SE' then output atlanta; if region = 'SW' then output phoenix; if region = 'NW' then output portland; run;
Which one of the following is true regarding the output data sets? A. No library references are required.
B. The data sets listed on all the IF statements require a library reference. C. The data sets listed in the last two IF statements require a library reference. D. The data sets listed in the first two IF statements require a library reference. 97
Which one of the following SAS DATA steps saves the temporary data set named MYDATA as a permanent data set?
A. libname sasdata 'SAS-data-library'; data sasdata.mydata; copy mydata;
37
run;
B. libname sasdata 'SAS-data-library'; data sasdata.mydata; keep mydata; run;
C. libname sasdata 'SAS-data-library'; data sasdata.mydata; save mydata; run;
D. libname sasdata 'SAS-data-library'; data sasdata.mydata; set mydata; run; 98
The following SAS DATA step is submitted: libname temp 'SAS-data-library'; data temp.report; set sasuser.houses; newvar = price * 1.04; run;
Which one of the following statements is true regarding the program above?
A. The program is reading from a temporary data set and writing to a temporary data set. B. The program is reading from a temporary data set and writing to a permanent data set. C. The program is reading from a permanent data set and writing to a temporary data set. D. The program is reading from a permanent data set and writing to a permanent data set. 99
The following SAS SORT procedure step generates an output data set: proc sort data = sasuser.houses out = report; by style; run;
In which library is the output data set stored? A.WORK B.REPORT. C.HOUSES D.SASUSER 100
The following SAS program is submitted: proc sort data=work.employee; by descending fname;
proc sort data=work.salary; by descending fname;
38
data work.empdata; merge work.employee work.salary; by fname; run;
Which one of the following statements explains why the program failed execution? A. The SORT procedures contain invalid syntax.
B. The merged data sets are not permanent SAS data sets.
C. The data sets were not merged in the order by which they were sorted. D. The RUN statements were omitted after each of the SORT procedures. 101
The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below: WORK.EMPLOYEE WORK.SALARY fname age name salary Bruce 30 Bruce 25000 Dan 40 Bruce 35000 Dan 25000
The following SAS program is submitted: data work.empdata;
by fname; totsal + salary; run;
Which one of the following statements completes the merge of the two data sets by the FNAME variable?
A. merge work.employee work.salary (fname = name); B. merge work.employee work.salary (name = fname); C. merge work.employee
work.salary (rename = (fname = name)); D. merge work.employee
work.salary (rename = (name = fname)); 102
The SAS data sets WORK.EMPLOYEE and WORK.SALARY are listed below: WORK.EMPLOYEE WORK.SALARY fname age fname salary Bruce 30 Bruce 25000 Dan 40 Bruce 35000 Dan 25000
The following SAS program is submitted: data work.empdata;
39
merge work.employee work.salary; by fname; totsal + salary; run;
How many variables are output to the WORK.EMPDATA data set? A. 3 B. 4 C. 5
D. No variables are output to the data set as the program fails to execute due to errors. 103
The contents of two SAS data sets named EMPLOYEE and SALARY are listed below: EMPLOYEE SALARY name age name salary Bruce 30 Bruce 40000 Dan 35 Bruce 35000 Dan 37000 Dan .
The following SAS program is submitted: data work.empsalary;
merge work.employee (in = inemp) work.salary (in = insal); by name;
if inemp and insal; run;
How many observations will the data set WORK.EMPSALARY contain? A. 2 B. 4 C. 5 D. 6 104
The following SAS program is submitted: data work.empsalary;
set work.people (in = inemp) work.money (in = insal); if insal and inemp; run;
The SAS data set WORK.PEOPLE has 5 observations, and the data set WORK.MONEY has 7 observations.
How many observations will the data set WORK.EMPSALARY contain? A. 0 B. 5
40