Which one of the following programs contains a syntax error?
A. proc sql; select product.*, cost.unitcost, sales.quantity from product p, cost c, sales s where p.item = c.item and
B. item = s.item; quit;
C. proc sql; select product.*, cost.unitcost, sales.quantity from product, cost, sales where product.item = cost.item and product.item = sales.item; quit;
D. proc sql; select p.*, c.unitcost, s.quantity from product as p, cost as c, sales as s where p.item = c.item and
E. item = s.item; quit;
F. proc sql; select p.*, c.unitcost, s.quantity from product, cost, sales where product.item = cost.item and product.item = sales.item; quit;
The variable attributes of SAS data sets ONE and TWO are shown below:
ONE TWO
# Variable Type Len Pos # Variable Type Len Pos 2 sales Num 8 8 2 budget Num 8 8 1 year Num 8 0 3 sales Char 8 16 1 year Num 8 0
Data set ONE contains 100 observations. Data set TWO contains 50 observations. Both data sets are sorted by the variable YEAR. The following SAS program is submitted:
data three;
merge one two;
by year;
run;
Which one of the following is the result of the program execution?
A. No messages are written to the SAS log.
B. ERROR and WARNING messages are written to the SAS log.
C. Data set THREE is created with two variables and 50 observations.
D. Data set THREE is created with three variables and 100 observations.
Given the following SAS data sets ONE and TWO:
ONE TWO
YEAR QTR BUDGET YEAR QTR SALES
------------------------------- --------------------------------- 2001 3 500 2001 4 300
2001 4 400 2002 1 600
2002 1 700
The following SAS program is submitted:
proc sql;
select one.*, sales
from one, two
where one.year = two.year;
quit;
Which one of the following reports is generated?
A. YEAR QTR BUDGET SALES --------------------------------------------------------- 2001 4 400 300 2002 1 700 600
B. YEAR QTR BUDGET SALES ---------------------------------------------------------- 2001 3 500 . 2001 4 400 300 2002 1 700 600
C. YEAR QTR BUDGET SALES ------------------------------------------------------------ 2001 3 500 300 2001 4 400 300 2002 1 700 600
D. YEAR QTR BUDGET SALES ------------------------------------------------------------ 2001 3 500 300 2001 4 400 300 2002 1 700 300 2001 3 500 600 2001 4 400 600 2002 1 700 600
Given the following SAS data sets ONE and TWO:
ONE TWO NUM CHAR1 NUM CHAR2
1 A 2 X
2 B 3 Y
4 D 5 V
The following SAS program is submitted creating the output table THREE:
data three;
set one two;
run;
THREE
NUM CHAR1 CHAR2
1 A 2 B 4 D 2 X 3 Y 5 V
Which one of the following SQL programs creates an equivalent SAS data set THREE?
A. proc sql; create table three as select * from one outer union corr select * from two; quit;
B. proc sql; create table three as select * from one outer union select * from two; quit;
C. proc sql; create table three as select * from one outer union select * quit;
D. proc sql; create table three as select * from one union corr select * from two; quit;
The SAS data set ONE has a variable X on which an index has been created. The data sets ONE and THREE are sorted by X. Which one of the following SAS programs uses the index to select observations from the data set ONE?
A. data two; set three; set one key = X; run;
B. data two; set three key = X; set one; run;
C. data two; set one; set three key = X; run;
D. data two; set three; set one (key = X); run;
Which one of the following options displays the value of a macro variable in the SAS log?
A. MACRO
B. SOURCE
C. SOURCE2
D. SYMBOLGEN
The following SAS program is submitted:
options yearcutoff = 1950;
%macro y2kopt(date);
%if anddate >= 14610 %then %do;
options yearcutoff = 2000;
%end;
%else %do;
options yearcutoff = 1900;
%end;
%mend;
data _null_ ;
date = "01jan2000"d;
call symput("date",left(date));
run;
%y2kopt(anddate)
The SAS date for January 1, 2000 is 14610 and the SAS system option for YEARCUTOFF is set to 1920 prior to submitting the above program.
Which one of the following is the value of YEARCUTOFF when the macro finishes execution?
A. 1900
B. 1920
C. 1950
D. 2000
Which one of the following options controls the pagesize of a SAS data set?
A. SIZE=
B. BUFNO=
C. BUFSIZE=
D. PAGESIZE=
Which one of the following SAS SORT procedure options eliminates identical consecutive observations?
A. NODUP
B. UNIQUE
C. DISTINCT
D. NODUPKEY
The following SAS FORMAT procedure is submitted:
proc format lib = sasuser;
value tempc low < 0 = 'BELOW FREEZING'
0 < 5 = 'COLD'
5 < 10 = 'MILD'
10 < 15 = 'WARM'
15 high = 'HOT';
run;
How is the value 10 displayed when the format TEMPC is applied?
A. 10
B. MILD
C. WARM
D. BELOW FREEZING