The SAS data set ONE consists of five million observations and has 25 variables. Which one of the following SAS programs successfully creates three new variables TOTREV, TOTCOST, and PROFIT and requires the least CPU time to be processed?
A. data two; set one; totrev = sum(price * quantity); totcost = sum(fixed,variable); profit = sum(totrev,otcost); if totrev > 1000; run;
B. data two; set one; totrev = sum(price * quantity); if totrev > 1000; totcost = sum(fixed,variable); profit = sum(totrev,otcost); run;
C. data two; set one; totrev = sum(price * quantity); where totrev > 1000; totcost = sum(fixed,variable); profit = sum(totrev,otcost); run;
D. data two; set one; where totrev > 1000; totrev = sum(price * quantity); totcost = sum(fixed,variable); profit = sum(totrev,otcost); run;
The following SAS program is submitted:
data temp;
array points{3,2}_temporary_ (10,20,30,40,50,60); score = points{2,1}
run;
Which one of the following is the value of the variable SCORE in the data set TEMP?
A. 10
B. 20
C. 30
D. 40
The following SAS program is submitted:
data temp;
array points{2,3}_temporary_;
run;
Which one of the following is the maximum number of elements that are stored?
A. 2
B. 3
C. 5
D. 6
Given the following SAS data sets ONE and TWO:
ONE TWO NUM COUNTRY NUM CITY
1 CANADA 3 BERLIN
2 FRANCE 5 TOKYO
3 GERMANY 4 BELGIUM
5 JAPAN
The following SAS program is submitted:
proc sql;
select country from one where not exists
(select * from two where one.num = two.num);
quit;
Which one of the following reports is generated?
A. COUNTRY
GERMANY
JAPAN
B. COUNTRY
FRANCE
BELGIUM
C. COUNTRY
CANADA
FRANCE
BELGIUM
D. COUNTRY
CANADA
FRANCE
GERMANY
The following SAS program is submitted:
%let lib = %upcase(sasuser);
proc sql;
select nvar
from dictionary.tables
where libname = "andlib";
quit;
Given that several SAS data sets exist in the SASUSER library, which one of the following is generated as output?
A. no result set
B. a syntax error in the log
C. a report showing the names of each table in SASUSER
D. a report showing the number of columns in each table in SASUSER
Given the following SAS data sets ONE and TWO:
ONE TWO OBS COMMON X OBS COMMON Y -------------------------- ------------------------------ 1 A 10 1 A 1 2 A 13 2 A 3 3 A 14 3 B 4 4 B 9 4 B 2 5 C 8 5 C 5 6 C 14
The following SAS DATA step is submitted: data combine; set one; set two; run; Which one of the following represents the data values stored in data set COMBINE?
A. OBS COMMON X Y
1 A 10 1
2 A 13 3
3 A 14 3
4 B 9 4
5 B 9 2
6 C 8 5
7 C 14 5
B. OBS COMMON X Y
1 A 10 1
2 A 13 3
3 B 9 4
4 C 8
C. OBS COMMON X Y
1 A 10 1
2 A 13 3
3 B 14 4
4 B 9 2
5 C 8 5
D. OBS COMMON X Y
1 A 10 1
2 A 13 1
3 A 14 1
4 A 10 3
5 A 13 3
6 A 14 3
7 B 9 4
8 B 9 2
9 C 8 5
10 C 14 5
The following SAS program is submitted: %let name = Patel's Restaurant;
Which one of the following statements avoids problems associated with the unbalanced quotation mark?
A. %let name = Patel%'s Restaurant;
B. %let name = %str(Patel's Restaurant);
C. %let name = Patel%str(')s Restaurant;
D. %let name = %str(Patel%'s Restaurant);
The following SAS program is submitted:
proc contents data = testdata.one;
run;
Which one of the following SQL statements produces similar information about the column attributes as the above CONTENTS procedure?
A. proc sql; show testdata.one; quit;
B. proc sql; describe testdata.one; quit;
C. proc sql; show table testdata.one; quit;
D. proc sql; describe table testdata.one; quit;
The following SAS code is submitted:
%macro houses(dsn = houses,sub = RANCH);
data anddsn;
set sasuser.houses;
if style = "andsub";
run;
%mend;
%houses(sub = SPLIT)
%houses(dsn = ranch)
%houses(sub = TWOSTORY)
Which one of the following is the value of the automatic macro variable SYSLAST?
A. work.ranch
B. work.houses
C. WORK.RANCH
D. WORK.HOUSES
Which one of the following statements about compressed SAS data sets is always true?
A. Each observation is treated as a single string of bytes.
B. Each observation occupies the same number of bytes.
C. An updated observation is stored in its original location.
D. New observations are added to the end of the SAS data set.