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;
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
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?
B. 2
C. 1.8
D. null
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 set ONE:
ONE COUNTRY CITY VISIT
USA BOSTON 10
UK LONDON 5
USA DALLAS 10
UK MARLOW 10
USA BOSTON 20
UK LONDON 15
USA DALLAS 10
The following SAS program is submitted:
proc sql;
select country, city, sum(visit) as TOTAL
from one group by country, city
order by country, total desc;
quit;
Which one of the following reports is generated?
A. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
USA BOSTON 50
USA DALLAS 20
B. COUNTRY CITY TOTAL
UK LONDON 20
UK MARLOW 10
USA BOSTON 50
USA DALLAS 20
C. COUNTRY CITY TOTAL
USA BOSTON 50 D. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
USA DALLAS 20
USA BOSTON 50
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;
merge one two;
by common;
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 5
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:
%macro test(var);
%let jobs = BLACKSMITH WORDSMITH SWORDSMITH;
%let type = %index(andjobs,andvar);
%mend;
%test(SMITH)
Which one of the following is the resulting value of the macro variable TYPE?
A. 0
B. 3
C. 6
D. null
Which one of the following is the purpose of the REUSE= YES option in a compressed SAS data set?
A. It temporarily compresses observations in a SAS data set.
B. It allows users to update the same SAS data set concurrently.
C. It allows new observations to be inserted wherever enough free space exists.
D. It specifies that a new empty data set with a given name replaces an existing data set with the same name.
Which one of the following SAS integrity constraint types ensures that a specific set or range of values are the only values in a variable?
A. CHECK
B. UNIQUE
C. FORMAT
D. DISTINCT
Which one of the following options is available for SAS macro debugging?
A. MLOGIC
B. MDEBUG
C. MSGLEVEL
D. MAUTOSOURCE
The following SAS program is submitted:
%let value = .5;
%let add = 5;
%let newval = %eval(andvalue + andadd);
Which one of the following is the resulting value of the macro variable NEWVAL?
A. 5
B. 5.5
C. .5 + 5
D. null
Which one of the following is an advantage of creating and using a SAS DATA step view?
A. It can store an index.
B. It always accesses the most current data.
C. It works quickly through multiple passes of the data.
D. It is useful when the underlying data file structure changes.
Given the following SAS data set ONE:
ONE COUNTRY CITY VISIT
USA BOSTON 10
UK LONDON 5
USA DALLAS
UK MARLOW 10
USA BOSTON 20
UK LONDON 15
USA DALLAS 10
The following SAS program is submitted:
proc sql;
select country, city, sum(visit) as TOTAL
from one group by country, city order by country, total desc; quit;
Which one of the following reports is generated?
A. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
USA BOSTON 50
USA DALLAS 20
B. COUNTRY CITY TOTAL
UK LONDON 20
UK MARLOW 10
USA BOSTON 50
USA DALLAS 20
C. COUNTRY CITY TOTAL
USA BOSTON 50
USA DALLAS 20
UK LONDON 20
UK MARLOW 10
D. COUNTRY CITY TOTAL
UK MARLOW 10
UK LONDON 20
USA DALLAS 20
USA BOSTON 50
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'; run;
D. data new;D.data new; set temp; if a = 6 then b = 'Large '; if a in (1, 2) then b = 'Medium'; if a = 8 then b = 'Small'; run;
Given the following SAS statement: %let idcode = Prod567;
Which one of the following statements stores the value 567 in the macro variable CODENUM?
A. %let codenum = substr(andidcode,length(andidcode)-2);
B. %let codenum = substr(andidcode,length(andidcode)-3);
C. %let codenum = %substr(andidcode,%length(andidcode)-2);
D. %let codenum = %substr(andidcode,%length(andidcode)-3);
The following SAS program is submitted:
%let first = yourname;
%let last = first;
%put andandandlast;
Which one of the following is the result in the log of the %PUT statement?
A. first
B. andfirst
C. yourname
D. andyourname