Which one of the following SAS statements correctly computes the average of four numerical values?
A. average = mean(num1 - num4);
B. average = mean(of num1 - num4)
C. average = mean(of num1 to num4);
D. average = mean(num1 num2 num3 num4);
The following SAS program is submitted:
data work.pieces; do while (n It 6); n + 1; end; run;
Which one of the following is the value of the variable N in the output data set?
A. 4
B. 5
C. 6
D. 7
The following SAS program is submitted:
data work.test;
Author = `Christie, Agatha';
First = substr(scan(author,2,' ,`),1, 1);
run;
Which one of the following is the value of the variable FIRST in the output data set?
A. A
B. C
C. Agatha
D. ``(missing character value)
The contents of the raw data file TYPECOLOR are listed below:
----|----10----|----20----|----30
Daisyyellow
The following SAS program is submitted:
data flowers; infile typecolor'; input type $ 1-5 +1 color$; run;
Which one of the following represents the values of the variables TYPE and COLOR?
A. type color daisy yellow
B. type color daisy ellow
C. type color daisyyellow (missing character value)
D. No values are stored as the program fails to execute fails to execute due to syntax errors.
A raw data file is listed below:
1901 2 1905 1 1910 6 1925 . 1941 1
The following SAS program is submitted and references the raw data file above:
data coins; infile `file-specification'; input year quantity;
Which one of the following completes the program and produces a non-missing value for the variable TOTQUANTITY in the last observation of the output data set?
A. totquantity + quantity;
B. totquantity = sum(totquantity + quantity);
C. totquantity 0; sum totquantity;
D. retain totquantity 0; totquantity = totquantity + quantity;
The following SAS program is submitted:
data work.new;
length word $7;
amount = 7;
if amount = 5 then word = `CAT';
else if amount = 7 then word = `DOG';
else word = `NONE!!!';
amount = 5;
run;
Which one of the following represents the values of the AMOUNT and WORD variables?
A. amount word 5 DOG
B. amount word 5 CAT
C. amount word 7 DOG
D. amount word 7 " " (missing character value)
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 WORKEMPSALARY contain?
A. 0
B. 5
C. 7
D. 12
The following SAS program is submitted:
data work.accounting; set work.dept1 work.dept2; run;
A character variable named JOBCOE is contained in both the WORK.DEPT1 and WORK.DEPT2 SAS data sets. The variable JOBCODE has a length of 5 in the WORK.DEPT1 data set and a length of 7 in the WORK.DEPT2 data set.
Which one of the following is the length of the variable JOBCODE in the output data set?
B. 7
C. 8
D. 12
The SASDATA.BANKS data set has five observations when the following SAS program is submitted; libname sasdata `SAS-data-library';
data allobs;
set sasdata.banks;
capitaI=0;
do year = 2000 to 2020 by 5;
capital + ((capital+2000) * rate);
output;
end;
run;
How many observations will the ALLOBS data set contain?
A. 5
B. 15
C. 20
D. 25
The following SAS program is submitted:
data work.test;
Author = `Agatha Christie';
First = substr(scan(author,1,' ,`)1 ,1);
run;
Which one of the following is the length of the variable FIRST in the output data set?
A. 1
B. 6
C. 15
D. 200