The SAS data set TEMP has the following distribution of values for variable A: A Frequency
1 500,000
2 500,000
6 7,000,000
8 3,000
Which one of the following SAS programs requires the least CPU time to be processed?
A. data new; set temp; if a = 8 then b = 'Small '; else if a in(1, 2) then b = 'Medium'; else if a = 6 then b = 'Large'; run;
B. data new; set temp; if a in (1, 2) then b = 'Medium'; else if a = 8 then b = 'Small'; else if a = 6 then b = 'Large'; run;
C. data new; set temp; if a = 6 then b = 'Large '; else if a in (1, 2) then b = 'Medium'; else if a = 8 then b = 'Small';
D. data new; set temp; if a = 6 then b = 'Large '; if a in (1, 2) then b = 'Small'; run;
When reading a SAS data file, what does the NOBS=option on the SET statement represent?
A. A variable that represents the total number of observation in the output data set(s)
B. A variable that represents a flag indicating the end of the file
C. A variable that represents the total number of observations in the input data set(s)
D. A variable that represents the current observation number
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;
The following SAS program is submitted:
%let value = 9;
%let value2 = 5;
%let newval = %eval(andvalue / andvalue2);
Which one of the following is the resulting value of the macro variable NEWVAL?
A. 1
B. 2
C. 1.8
D. null
The following SAS program is submitted:
%let a = cat;
%macro animal(a = frog);
%let a = bird;
%mend;
%animal(a = pig)
%put a is anda;
Which one of the following is written to the SAS log?
A. a is anda
B. a is cat
C. a is pig
D. a is bird
Given the following SAS data set ONE:
ONE
DIVISION SALES
A 1234
A 3654
B 5678
The following SAS program is submitted:
data _null_;
set one;
by division;
if first.division then
call symput('mfirst',sales);
if last.division then
call symput('mlast',sales);
run;
Which one of the following is the value of the macro variable MFIRST when the above program finishes execution?
A. null
B. 1234
C. 3654
D. 5678
Given the SAS data set ONE:
ONE
DIVISION SALES
A 1234
A 3654
B 5678
The following SAS program is submitted:
Data_null_;
Set one;
By divition;
If first.division then
Do;
%let mfirst=sales;
end;
run;
What is the value of the macro variable MFRIST when the program finishes execution?
A. 1234
B. sales
C. 5678
D. null
The following SAS program is submitted:
What is the value of the macro variable Newval when the %PUT statement executes?
A. 0.555
B. 2.2
C. 1
D. 2
Which one of the following is the purpose of the IDXNAME= data set option?
A. It instructs SAS to name and store a specific index.
B. It instructs SAS to store an index in a particular location.
C. It instructs SAS to use a specific index for WHERE processing.
D. It instructs SAS to use any available index for WHERE processing.
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;