Given the SAS data set SASDATA TWO:
SASDATA TWO X Y
5 2
3 1
5 6
The following SAS program is submitted:
data sasuser.one two sasdata.three;
set sasdata two;
if x = 5 then output sasuser.one;
else output sasdata two;
run;
What is the result?
A. data set SASUSER.ONE has 5 observations data set SASUSER.TWO has 5 observations data set WORK.OTHER has 3 observations
B. data set SASUSER.ONE has 2 observations data set SASUSER.TWO has 2 observations data set WORK.OTHER has 1 observations
C. data set SASUSER.ONE has 2 observations data set SASUSER.TWO has 2 observations data set WORK.OTHER has 5 observations
D. No data sets are output. The DATA step fails execution due to syntax errors.
The SAS data set PETS is sorted by the variables TYPE and BREED.
The following SAS program is submitted:
proc print data = pets;
var type breed;
sum number;
run;
What is the result?
A. The SUM statement produces only a grand total of NUMBER.
B. The SUM statement produces only subtotals of NUMBER for each value of TYPE.
C. The SUM statement produces both a grand total of NUMBER and subtotals of NUMBER for each value of TYPE.
D. Nothing is produced by the SUM statement; the program fails to execute.
The data set RALESTATE has the variable LOCALFEE with a format or 9. and a variable
COUNTRYFEE with a format or 7.;
The following SAS program is submitted:
data history;
format local fee country fee percent6.;
set realestate;
local fee = local fee / 100;
country fee = country fee / 100;
run;
What are the formats of the variables LOCALFEE and COUNTRYFEE in the output dataset?
A. LOCALFEE has format of 9. and COUNTRYFEE has a format of 7.
B. LOCALFEE has format of 9. and COUNTRYFEE has a format of percent6.
C. LOCALFEE has format of percent6. and COUNTRYFEE has a format of percent6.
D. The data step fails execution; there is no format for LOCALFEE
Given the raw data file YEARAMT:
----|---10---|---20---|----30
1901 2
1905 1
1910 6
1925 .
1941 1
The following SAS program is submitted:
data coins;
infile `yearamt';
input year quantity;
run;
Which statement(s) completed the program and produced a non-missing value for the variable
TOTQUANTITY in the final observation of the output data set?
A. totquantity + quantity;
B. totquantity = sum(totquantity + quantity);
C. retain totquantity; totquantity = totquantity + quantity;
D. retain totquantity0; totquantity = totquantity + quantity;
After a SAS program is submitted, the following is written to the SAS log:
105 data january;
106 set allmonths(keep = product month num_sold cost);
107 if month = `Jan' then output january;
108 sales = cost * num_sold;
109 keep = product sales;
ERROR 22-322: Syntax error, expecting one of the following:!,
!!, and, *,**, +, -,/, <,< =, <>, =, >, ><, >=,
AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,
NOTIN, OR,^=,|,II,
110 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);
A raw data file is listed below:
--------10-------20-------30
squash 1.10
apples 2.25
juice 1.69
The following SAS program is submitted using the raw data file above:
data groceries;
infile 'file-specification';
input item $ cost;
run;
Which one of the following completes the program and produces a grand total for all COST values?
A. grandtot = sum cost;
B. grandtot = sum(grandtot,cost);
C. retain grandtot 0; grandtot = sum(grandtot,cost);
D. grandtot = sum(grandtot,cost); output grandtot
A raw data file is listed below:
--------10-------20-------30
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
The following SAS program is submitted using the raw data file as input:
data work.homework;
infile 'file-specification';
input name $ age height;
if age LE 10;
run;
How many observations will the WORK.HOMEWORK data set contain?
A. 0
B. 2
C. 3
D. No data set is created as the program fails to execute due to errors.
Given the data sets below: WORK.EMP with variables: WORK.NEWHIRE with variables:
The following SAS program is submitted:
The SAS data set WORK.EMP has 50 observations, and the data set WORK.NEWHIRE has 4 observations.
How many variables will the data set WORK.ALLEMP contain?
A. 3
B. The program fails execution.
C. 6
D. 4
Given the SAS data set WORK.TEMPS with numeric variables Day and Temp and character variable Month:
The following SAS program is submitted:
proc sort data=WORK.TEMPS; by Day descending Month; run;
proc print data=WORK.TEMPS; run;
Which output is correct?
A. B. C. D.
The following SAS program is submitted:
data WORK.PRODUCTS;
Prod=1;
do while (Prod LE 7);
Prod + 1;
end;
run;
What is the value of the variable Prod in the output data set?
A. 7
B. 8
C. 6
D. .(missing numeric)