Quiz
Crackman ADV 63
This quiz has a time limit, so it opens in the usual player.
Questions in this quiz (61)
1The SAS data set WORK.CHECK has a variable named Id_Code in it. Which SQL statement would create an index on this variable?
- Acreate index Id_Code on WORK.CHECK;
- Bcreate index(Id_Code) on WORK.CHECK;
- Cmake index=Id_Code from WORK.CHECK;
- Ddefine index(Id_Code) in WORK.CHECK;
2Given the SAS data sets:
WORK.EMPLOYEE WORK.NEWEMPLOYEE
Name Dept Names Salary
——– —– ——– ——
Alan Sales Michelle 50000
Michelle Sales Paresh 60000
A SAS program is submitted and
the following is written to the SAS log:
101 proc sql;
102 select dept, name
103 from WORK.EMPLOYEE
104 where name=(select names
from newemployee
where salary > 40000)
ERROR: Subquery evaluated to more than one row.
105 ;
106 quit;
What would allow the program to successfully execute without errors?- AReplace the where clause with:
where EMPLOYEE.Name=(select Names delimited with \’,\’
from WORK.NEWEMPLOYEE
where Salary > 40000); - BReplace line 104 with:
where EMPLOYEE.Name =ANY (select Names separated with \’,\’
from WORK.NEWEMPLOYEE
where Salary > 40000); - CReplace the equal sign with the IN operator.
- DQualify the column names with the table names
- AReplace the where clause with:
3Given the SAS data set SASUSER.HIGHWAY:
Steering Seatbelt Speed Status Count
——– ——– —– ——- —–
absent No 0-29 serious 31
absent No 0-29 not 1419
absent No 30-49 serious 191
absent no 30-49 not 2004
absent no 50+ serious 216
The following SAS program is submitted:
proc sql noprint;
select distinct
Speed [_insert_SQL_clause_]
from SASUSER.HIGHWAY
;
quit;
title1 \”Speed values represented are: &GROUPS\”;
proc print data=SASUSER.HIGHWAY;
run;
Which SQL clause stores the text 0-29,30-49,50+ in
the macro variable GROUPS?- Ainto &GROUPS
- Binto :GROUPS
- Cinto :GROUPS separated by \’,\’
- Dinto &GROUPS separated by \’,\’
4 The SAS data set WORK.CHECK has an index
on the variable Code and the following SAS
program is submitted.
proc sort data=WORK.CHECK;
by Code;
run;
Which describes the result of submitting the SAS program?- AThe index on Code is deleted.
- BThe index on Code is updated.
- CThe index on Code is uneffected.
- DThe sort does not execute.
5The following SAS program is submitted:
%let Value=9;
%let Add=5;
%let Newval=%eval(&Value/&Add);
%put &Newval;
What is the value of the macro variable newval when the %PUT statement executes?- A0.555
- B2
- C1.8
- D1
6 Given the SAS data set WORK.TRANSACT:
Rep Cost Ship
—– —– —–
SMITH 200 50
SMITH 400 20
JONES 100 10
SMITH 600 100
JONES 100 5
The following output is desired:
Rep
—– —-
JONES 105
SMITH 250
Which SQL statement was used?- Aselect rep,min(Cost+Ship)
from WORK.TRANSACT order by Rep; - Bselect Rep,min(Cost,Ship) as Min
from WORK.TRANSACT
summary by Rep order by Rep; - Cselect Rep,min(Cost,Ship)
from WORK.TRANSACT
group by Rep order by Rep; - Dselect Rep,min(Cost+Ship)
from WORK.TRANSACT
group by Rep order by Rep;
- Aselect rep,min(Cost+Ship)
7The table WORK.PILOTS contains the following data:
WORK.PILOTS
Id Name Jobcode Salary
— —— ——- ——
001 Albert PT1 50000
002 Brenda PT1 70000
003 Carl PT1 60000
004 Donna PT2 80000
005 Edward PT2 90000
006 Flora PT3 100000
The data set was summarized to include average
salary based on jobcode:
Jobcode Salary Avg
——- —— —–
PT1 50000 60000
PT1 70000 60000
PT1 60000 60000
PT2 80000 85000
PT2 90000 85000
PT3 100000 100000
Which SQL statement could NOT generate this result?- Aselect
Jobcode,
Salary,
avg(Salary) label=\’Avg\’
from WORK.PILOTS
group by Jobcode
order by Id ; - Bselect
Jobcode,
Salary,
(select avg(Salary)
from WORK.PILOTS as P1
where P1.Jobcode=P2.Jobcode) as Avg
from WORK.PILOTS as P2
order by Id
; - Cselect
Jobcode,
Salary,
(select avg(Salary)
from WORK.PILOTS
group by Jobcode) as Avg
from WORK.PILOTS
order by Id
; - Dselect
Jobcode,
Salary,
Avg
from
WORK.PILOTS,
(select
Jobcode as Jc,
avg(Salary) as Avg
from WORK.PILOTS
group by 1)
where Jobcode=Jc
order by Id
- Aselect
8Given the SAS data sets:
WORK.ONE WORK.TWO
Id Name Id Salary
— —— — ——
112 Smith 243 150000
243 Wei 355 45000
457 Jones 523 75000
The following SAS program is submitted:
data WORK.COMBINE;
merge WORK.ONE WORK.TWO;
by Id;
run;
Which SQL procedure statement produces
the same results?- Acreate table WORK.COMBINE as
select
Id,
Name,
Salary
from
WORK.ONE
full join
WORK.TWO
on ONE.Id=TWO.Id
; - Bcreate table WORK.COMBINE as
select
coalesce(ONE.Id, TWO.Id) as Id,
Name,
Salary
from
WORK.ONE,
WORK.TWO
where ONE.Id=TWO.Id
; - Ccreate table WORK.COMBINE as
select
coalesce(ONE.Id, TWO.Id) as Id,
Name,
Salary
from
WORK.ONE
full join
WORK.TWO
on ONE.Id=TWO.Id
order by Id
; - Dcreate table WORK.COMBINE as
select
coalesce(ONE.Id, TWO.Id) as Id,
Name,
Salary
from
WORK.ONE,
WORK.TWO
where ONE.Id=TWO.Id
order by ONE.Id
;
- Acreate table WORK.COMBINE as
9The following SAS program is submitted:
proc contents data=TESTDATA.ONE;
run;
Which SQL procedure step produces
similar information about the column
attributes of TESTDATA.ONE?- Aproc sql;
contents from TESTDATA.ONE;
quit; - Bproc sql;
describe from TESTDATA.ONE;
quit; - Cproc sql;
contents table TESTDATA.ONE;
quit; - Dproc sql;
describe table TESTDATA.ONE;
quit;
- Aproc sql;
10Given the SAS data set WORK.ONE:
Rep Cost
—– —-
SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
The following SAS program is submitted;
proc sql;
select
Rep,
avg(Cost)
from WORK.ONE
order by Rep
;
quit;
Which result set would be generated?- AJONES 280
JONES 280
SMITH 280
SMITH 280
SMITH 280 - BJONES 600
SMITH 100 - CJONES 280
SMITH 280 - DJONES 100
JONES 100
SMITH 600
SMITH 600
SMITH 600
- AJONES 280
11Given the SAS data sets:
WORK.MATH1A WORK.MATH1B
Name Fi Name Fi
——- — —— —
Lauren L Smith M
Patel A Lauren L
Chang Z Patel A
Hillier R
The following SAS program is submitted:
proc sql;
select *
from WORK.MATH1A
[_insert_set_operator_]
select *
from WORK.MATH1B
;
quit;
The following output is desired:
Name Fi
——- —
Lauren L
Patel A
Chang Z
Hillier R
Smith M
Lauren L
Patel A
Which SQL set operator completes the program and generates the desired output?- Aappend corr
- Bunion corr
- Couter union corr
- Dintersect corr
12Given the dataset WORK.STUDENTS:
Name Age
——- —
Mary 15
Philip 16
Robert 12
Ronald 15
The following SAS program is submitted:
%let Value=Philip;
proc print data=WORK.STUDENTS;
[_insert_WHERE_statement_]
run;
Which WHERE statement successfully completes the program and produces a report?- Awhere upcase(Name)=upcase(&Value);
- Bwhere upcase(Name)=%upcase(&Value);
- Cwhere upcase(Name)=\”upcase(&Value)\”;
- Dwhere upcase(Name)=\”%upcase(&Value)\”;
13The following SAS program is submitted:
data WORK.TEMP;
length A B 3 X;
infile RAWDATA;
input A B X;
run;
What is the length of variable A?- A3
- B8
- CWORK.TEMP is not created – X has an invalid length.
- DUnknown
14The following SAS program is submitted:
data WORK.NEW;
do i=1, 2, 3;
Next=cats(\’March\’ || i );
infile XYZ
filevar=Next
end=Eof;
do until (Eof);
input Dept $ Sales;
end;
end;
run;
The purpose of the FILEVAR=option on the
INFILE statement is to name the variable
Next, whose value:- Apoints to a new input file.
- Bis output to the SAS data set WORK.NEW.
- Cis an input SAS data set reference.
- Dpoints to an aggregate storage location.
15Given the following partial SAS log:
NOTE: SQL table SASHELP.CLASS was created like:
create table SASHELP.CLASS( bufsize=4096 )
(
Name char(8),
Sex char(1),
Age num,
Height num,
Weight num
);
Which SQL procedure statement generated this output?- ACONTENTS FROM SASHELP.CLASS;
- BCREATE FROM SASHELP.CLASS INTO LOG;
- CDESCRIBE TABLE SASHELP.CLASS;
- DVALIDATE SELECT * FROM SASHELP.CLASS;
16Given the SAS data set SASUSER.HIGHWAY:
Steering Seatbelt Speed Status Count
——– ——– —– ——- —–
absent No 0-29 serious 31
absent No 0-29 not 1419
absent No 30-49 serious 191
absent no 30-49 not 2004
absent no 50+ serious 216
The following SAS program is submitted:
%macro SPLIT;
proc sort
data=SASUSER.HIGHWAY
out=WORK.UNIQUES(keep=Status)
nodupkey;
by Status;
run;
data _null_;
set uniques end=Lastobs;
call symputx(\’Status\’||left(_n_),Status);
if Lastobs then call symputx(\’Count\’,_n_);
run;
%local i;
data
%do i=1 %to &count;
[_insert_reference_]
%end;
;
set SASUSER.HIGHWAY;
select(Status);
%do i=1 %to &Count;
when(\”[_insert_reference_]\”) output [_insert_reference_];
%end;
otherwise;
end;
run;
%mend;
%SPLIT
What macro variable reference completes
the program to create the WORK.NOT and
WORK.SERIOUS data sets?- A&Status&i
- B&&Status&i
- C&Status&Count
- D&&Status&Count
17The following SAS program is submitted:
%let Num1=7;
%let Num2=3;
%let Result=%eval(&Num1/&Num2);
%put &Result;
What is the value of the macro variable Result
when the %PUT statement executes?- A2.3
- B2
- C. (missing value)
- D2.33333333333333
18Given the SAS data set SASUSER.HIGHWAY:
Steering Seatbelt Speed Status Count
——– ——– —– ——- —–
absent No 0-29 serious 31
absent No 0-29 not 1419
absent No 30-49 serious 191
absent no 30-49 not 2004
absent no 50+ serious 216
The following SAS program is submitted:
%macro HIGHWAY(Belt=no);
proc print data=SASUSER.HIGHWAY;
where Seatbelt=\”&Belt\” ;
run;
%mend;
%HIGHWAY(Belt=No)
How many observations appear in
the generated report?- A0
- B2
- C3
- D5
19Given the following SAS data sets:
WORK.VISIT1 WORK.VISIT2
Id Expense Id Cost
— ——- — —-
001 500 001 300
001 400 002 600
003 350
The following result set was summarized and
consolidated using the SQL procedure:
Id Cost
— —-
001 300
001 900
002 600
003 350
Which of the following SQL statements was
most likely used to generate this result?- Aselect
Id,
sum(Expense) label=\’COST\’
from WORK.VISIT1
group by 1
union all
select
Id,
sum(Cost)
from WORK.VISIT2
group by 1
order by 1,2
; - Bselect
id,
sum(expense) as COST
from
WORK.VISIT1(rename=(Expense=Cost)),
WORK.VISIT2
where VISIT1.Id=VISIT2.Id
group by Id
order by
Id,
Cost
; - Cselect
VISIT1.Id,
sum(Cost) as Cost
from
WORK.VISIT1(rename=(Expense=Cost)),
WORK.VISIT2
where VISIT1.Id=VISIT2.Id
group by Id
order by
Id,
Cost
; - Dselect
Id,
sum(Expense) as Cost
from WORK.VISIT1
group by Id
outer union corr
select
Id,
sum(Cost)
from WORK.VISIT2
group by Id
order by 1,2
;
- Aselect
20Given the SAS data sets:
WORK.FIRST WORK.SECOND
Common X Common Y
—— — —— —
A 10 A 1
A 13 A 3
A 14 B 4
B 9 B 2
The following SAS program is submitted:
data WORK.COMBINE;
set WORK.FIRST;
set WORK.SECOND;
run;
What data values are stored in data
set WORK.COMBINE?- ACommon X Y
—— — —
A 10 1
A 13 3
B 14 4
B 9 2 - BCommon X Y
—— — —
A 10 1
A 13 3
A 14 3
B 9 4
B 9 2 - CCommon X Y
—— — —
A 10 1
A 13 3
A 14 .
B 9 4
B . 2 - DCommon X Y
—— — —
A 10 1
A 13 1
A 14 1
A 10 3
A 13 3
A 14 3
B 9 4
B 9 2
- ACommon X Y
21 The following SAS program is submitted:
%let product=merchandise;
[_insert_%put_statement_]
and the following message is written to the SAS log:
the value is \”merchandise\”
Which macro statement wrote this message?- A%put the value is \’\”\’&product.\’\”\’;
- B%put the value is %quote(&product.);
- C%put the value is \”&product.\”;
- D%put the value is \”\”&product.\”\”;
22Given the SAS data sets:
WORK.ONE WORK.TWO
X Y SumY
— — —-
A 10 36
A 3
A 14
B 9
The following SAS DATA step is submitted:
data WORK.COMBINE;
if _n_=1 then set WORK.TWO;
set WORK.ONE;
run;
What data values are stored in data set WORK.COMBINE?- AAn ERROR message is written to the SAS log and
the data set WORK.COMBINE is not created. - BSumY X Y
—- — —
36 A 10 - CSumY X Y
—- — —
36 A 10
. A 3
. A 14
. B 9 - DSumY X Y
—- — —
36 A 10
36 A 3
36 A 14
36 B 9
- AAn ERROR message is written to the SAS log and
23Which of the following ARRAY statements is similar
to the statement array Yr{1974:2007} Yr1974-Yr2007;
and will compile without errors?- Aarray Yr{34} Yr1974-Yr2007;
- Barray Yr{74:07} Yr1974-Yr2007;
- Carray Yr{74-07} Yr1974-Yr2007;
- Darray Yr{1974-2007} Yr1974-Yr2007;
24Given the following program
and desired results:
%let Thing1=gift;
%let Thing2=surprise;
%let Gift1=book;
%let Gift2=jewelry;
%let Surprise1=dinner;
%let Surprise2=movie;
%let Pick=2;
%let Choice=surprise;
Desired %PUT Results in LOG:
My favorite surprise is a movie
What is the correct %PUT statement
that generates the desired results?- A%put My favorite &Thing&Pick is a &&Choice&Pick;
- B%put My favorite &&Thing&pick is a &&&Choice&Pick;
- C%put My favorite &Choice&pick is a &&Thing&Pick;
- D%put My favorite &&Choice&pick is a &&&Thing&Pick;
25Given the SAS dataset WORK.ONE
Name Salary
—– ——
Hans 200
Maria 205
Jose 310
Ariel 523
The following SAS program is submitted:
proc sql;
[_insert_select_clause_]
from WORK.ONE
;
quit;
The following output is desired:
Salary Bonus
—— —–
200 20
205 20.5
310 31
523 52.3
Which SQL procedure clause completes
the program and generates the desired output?- Aselect Salary Bonus as Salary*.10 as Bonus
- Bselect Salary Bonus=Salary*.10 \’Bonus\’
- Cselect Salary, Salary*.10 label=\’Bonus\’
- Dselect Salary, Salary*.10 column=\”Bonus\”
26The following SAS program is submitted:
options reuse=YES;
data SASUSER.REALESTATE(compress=CHAR);
set SASUSER.HOUSES;
run;
What is the effect of
the reuse=YES SAS system option?- AIt allows updates in place.
- BIt tracks and recycles free space.
- CIt allows a permanently stored SAS data set to be replaced.
- DIt allows users to access the same
27Given the SAS data sets:
WORK.CLASS1 WORK.CLASS2
Name Course Name Class
—— —— ——- —–
Lauren MATH1 Smith MATH2
Patel MATH1 Farmer MATH2
Chang MATH1 Patel MATH2
Chang MATH3 Hillier MATH2
The following SAS program is submitted:
proc sql;
select Name
from WORK.CLASS1
[_insert_set_operator_]
select Name
from WORK.CLASS2
;
quit;
The following output is desired:
Name
——
Chang
Chang
Lauren
Which SQL set operator completes the program
and generates the desired output?- Aintersect corr
- Bexcept all
- Cintersect all
- Dleft except
28The following SAS program is submitted:
%macro CHECK(Num=4);
%let Result=%eval(&Num gt 5);
%put Result is &result;
%mend;
%check(Num=10)
What is written to the SAS log?- AResult is 0
- BResult is 1
- CResult is 10 gt 5
- DResult is true
29The following SAS program is submitted:
%let Mv=shoes;
%macro PRODUCT(Mv=bicycles);
%let Mv=clothes;
%mend;
%PRODUCT(Mv=tents)
%put Mv is &Mv;
What is written to the SAS log?- AMv is bicycles
- BMv is clothes
- CMv is shoes
- DMv is tents
30The following SAS program is submitted:
%macro COLS1;
Name Age;
%mend;
%macro COLS2;
Height Weight;
%mend;
proc print data=SASHELP.CLASS;
[_insert_VAR_statement_here_]
run;
Which VAR statement successfully completes
the program to produce a report containing
four variables?- Avar %COLS1 %COLS2;
- Bvar %COLS1-%COLS2;
- Cvar %COLS1 Weight Height;
- Dvar Weight Height %COLS1;
31Given the following macro program
and invocation:
%macro MAKEPGM(NEWNAME, SETNAME);
data &NEWNAME;
set &SETNAME;
run;
%put —> inside macro &NEWNAME &SETNAME;
%mend;
%MAKEPGM(WORK.NEW, SASHELP.CLASS)
%put —> outside macro &NEWNAME &SETNAME;
Which of these choices shows the correct %PUT
statement output if the program is submitted at
the beginning of a new SAS session? Note that
other lines may be written to the SAS log by the program but only the %PUT output is shown here.- A—> inside macro WORK.NEW SASHELP.CLASS
—> outside invocation WORK.NEW SASHELP.CLASS - B—> inside macro WORK.NEW SASHELP.CLASS
—> outside invocation &NEWNAME &SETNAME - C—> inside macro &NEWNAME &SETNAME
—> outside invocation WORK.NEW SASHELP.CLASS - D—> inside macro &NEWNAME &SETNAME
—> outside invocation &NEWNAME &SETNAME
- A—> inside macro WORK.NEW SASHELP.CLASS
32In a data step merge, the BY variables
in all data sets must have the same:- Aname
- Bname and type.
- Cname, type, and length.
- Dname and length.
33Given the data set SASHELP.CLASS:
Name Age
——- —
Mary 15
Philip 16
Robert 12
Ronald 15
The following SAS program is submitted:
%macro MP_ONE(pname=means);
proc &pname data=SASHELP.CLASS;
run;
%mend;
%MP_ONE(print)
%MP_ONE()
Which PROC steps execute successfully?- APROC MEANS only
- BPROC PRINT only
- CPROC MEANS and PROC PRINT
- DNo PROC steps execute successfully
34Which of the following is true about the COMPRESS=YES data set option?
- AIt uses the Ross Data Compression method to compress numeric data.
- BIt is most effective with character data that contains repeated characters.
- CIt is most effective with numeric data that represents large numeric values.
- DIt is most effective with character data that contains patterns, rather than simple repetitions.
35data _null_;
set WORK.ADDRESSES;
[_insert_statement_]
put \”filename mail email \’\” Email_Address \”\’; \”;
put \”data _null_;\”;
put \” file mail;\”;
put \” put \’Thank you for your continued\’;\”;
put \” put \’support of The XYZ Corporation.\’;\”;
put \” put \’We appreciate your patronage.\’;\”;
put \” put \’Sincerely,\’;\” ;
put \” put \’The XYZ Corporation\’;\”;
put \”run;\” ;
run;
Which statement completes the program and creates a SAS program file?- Ainfile \”c:\\email.sas\”;
- Boutput \”c:\\email.sas\”;
- Cfile \”c:\\email.sas\”;
- DNone of the above.
36The SAS data set WORK.TEMP is indexed
on the variable Id:
Id Amount
— ——
P 52
P 45
A 13
A 56
R 34
R 12
R 78
The following SAS program is submitted:
proc print data=WORK.TEMP;
[_insert_BY_statement_]
run;
Which BY statement completes the program, creates a listing report that is grouped by Id, and completes without errors?- Aby Id;
- Bby Id grouped;
- Cby Id descending;
- Dby descending Id;
37Which macro statement would remove the macro variable Mv_Info from the symbol table?
- A%mdelete &Mv_Info;
- B%symerase Mv_Info;
- C%symdel &Mv_Info;
- D%symdel Mv_Info;
38To create a list of unique Customer_Id
values from the customer data set, which
of the following techniques can be used?
technique 1: proc SORT with NODUPKEY and OUT=
technique 2: data step with IF FIRST.Customer_Id=1
technique 3: proc SQL with the SELECT DISTINCT statement- Aonly technique 1
- Btechniques 1 and 2
- Ctechniques 1 and 3
- Dtechniques 1, 2, or 3
39When attempting to minimize memory usage, the most efficient way to do group processing when using the MEANS procedure is to use:
- Athe BY statement.
- BGROUPBY with the NOTSORTED specification.
- Cthe CLASS statement.
- Dmultiple WHERE statements.
40A quick rule of thumb for the space required to run PROC SORT is:
- Atwo times the size of the SAS data set being sorted.
- Bthree times the size of the SAS data set being sorted.
- Cfour times the size of the SAS data set being sorted.
- Dfive times the size of the SAS data set being sorted.
41 Multi-threaded processing for PROC SORT will affect which of these system resources?
- ACPU time will decrease, wall clock time will decrease
- BCPU time will increase, wall clock time will decrease
- CCPU time will decrease, wall clock time will increase
- DCPU time will increase, wall clock time will increase
42The following SAS code is submitted:
data WORK.TEMP WORK.ERRORS / view=WORK.TEMP; infile RAWDATA;
input Xa Xb Xc;
if Xa=. then output WORK.ERRORS;
else output WORK.TEMP; run;
Which of the following is true of the WORK.ERRORS data set?- AThe data set is created when the DATA step is submitted
- BThe data set is created when the view TEMP is used in another SAS step.
- CThe data set is not created because the DATA statement contains a syntax error.
- DThe descriptor portion of WORK.ERRORS is created when the DATA step is submitted.
43Which title statement would always display the current date?
- Atitle "Today is: &sysdate.";
- Btitle "Today is: &sysdate9.";
- Ctitle "Today is: &today.";
- Dtitle "Today is: %sysfunc(today(),worddate.)";
44Which of the following is an advantage of SAS views?
- ASAS views can access the most current data in files that are frequently updated.
- BSAS views can avoid storing a SAS copy of a large data file.
- CSAS views can decrease programming time.
- Dboth A and B are true
45In what order does SAS search for format definitions by default?
- A1. WORK.FORMATS 2. LIBRARY.FORMATS
- B1. LIBRARY.FORMATS 2. WORK.FORMATS
- CThere is no default order, it must be defined by the user.
- DAll user defined libraries that have a catalog named FORMATS, in alphabetic order.
46The following SAS program is submitted:
%macro execute; [_insert_statement_here_]
proc print data=SASUSER.HOUSES;
run; %end;
%mend execute; %execute
Which statement completes the program so that the PROC PRINT step executes on Thursday?- Aif &sysday = Thursday then %do;
- B%if &sysday = Thursday %then %do;
- C%if "&sysday" = Thursday %then %do;
- D%if &sysday = "Thursday" %then %do;
47The following program is submitted to check the variables Xa, Xb, and Xc in the SASUSER.LOOK data set:
data _null_ WORK.BAD_DATA / view=WORK.BAD_DATA ; set SASUSER.LOOK(keep=Xa Xb Xc);
length _Check_ $ 10 ;
if Xa=. then _check_=trim(_Check_)!!" Xa" ;
if Xb=. then _check_=trim(_Check_)!!" Xb" ; if Xc=. then _check_=trim(_Check_)!!" Xc" ; put Xa= Xb= Xc= _check_= ;
run ;
When is the PUT statement executed?- Awhen the code is submitted
- Bonly when the WORK.BAD_DATA view is used
- Cboth when the code is submitted and the view is used
- Dnever, the use of _null_ in a view is a syntax error
48The following SAS program is submitted:
data WORK.NEW(bufno=4); set WORK.OLD(bufno=3);
run;
Why are the BUFNO options used?- Ato reduce memory usage
- Bto reduce CPU time usage
- Cto reduce the amount of data read
- Dto reduce the number of I/O operations
49Which statement is true for Data step HASH objects?
- AThe key component must be numeric.
- BThe data component may consist of numeric and character values.
- CThe HASH object is created in one step and referenced in another.
- DThe HASH object must be smaller than 2 to the 8th power bytes.
50Which of the following SAS System options can aid in benchmarking?
- ABUFSIZE= and BUFNO=
- BFULLSTIMER
- CIOBLOCKSIZE=
- DSYSTIMER
51Given the following macro program:
%macro MAKEPGM(NEWNAME, SETNAME, PRINT); data &NEWNAME;
set &SETNAME; run;
%if &PRINT=YES %then %do;
proc print data=&NEWNAME.(obs=10); run ;
%end; %mend;
Which option would provide feedback in the log about the parameter values passed into this macro when invoked?- AMPRINT
- BMDEBUG
- CMLOGIC
- DMPARAM
52The NOTSORTED option on the BY statement cannot be used with which other statement or option?
- ASET
- BMERGE
- CIF FIRST.by-variable
- DBY GROUPFORMAT by-variable
53Given the SAS data set WORK.ONE:
Rep -----
SMITH SMITH JONES SMITH JONES
Cost ----
200
400
100
600
100
Page 33 of 48
The following SAS program is submitted: proc sql;
select Rep,
avg(Cost) as Average
from WORK.ONE [either__insert_SQL_where_clause_] group by Rep
[_or_ _insert_SQL_having_clause_] ;
quit;
The following output is desired:
Rep ----- SMITH
Average -------
400
Which SQL clause completes the program and generates the desired output?- Awhere calculated Average > (select avg(Cost) from WORK.ONE)
- Bhaving Average > (select avg(Cost) from WORK.ONE)
- Chaving avg(Cost) < (select avg(Cost) from WORK.ONE)
- Dwhere avg(Cost) > (select avg(Cost) from WORK.ONE)
54Which dictionary table provides information on each occurrence of the variable named LastName?
- ADICTIONARY.TABLES
- BDICTIONARY.COLUMNS
- CDICTIONARY.MEMBERS
- DDICTIONARY.VARIABLES
55The SAS data set WORK.TEST has an index on the variable Id and the following SAS
program is submitted.
data WORK.TEST;
set WORK.TEST( keep=Id Var_1 Var_2 rename=(Id=Id_Code)); Total=sum(Var_1, Var_2);
run;
Which describes the result of submitting the SAS program?- AThe index on Id is deleted.
- BThe index on Id is updated as an index on Id_Code.
- CThe index on Id is deleted and an index on Id_Code is created.
- DThe index on Id is recreated as an index on Id_Code.
56Given the SAS dataset WORK.ONE: Salary
file mail;";
put 'Thank you for your continued';"; put 'support of The XYZ Corporation.';"; put 'We appreciate your patronage.';"; put 'Sincerely,';" ;
put 'The XYZ Corporation';";
------
200
205
.
523
The following SAS program is submitted:
proc sql; select *
from WORK.ONE [_insert_where_clause_] ;
quit;
The following output is desired:
Salary ------
200 205 523
Which WHERE expression completes the program and generates the desired output?- Awhere Salary is not .
- Bwhere Salary ne missing
- Cwhere Salary ne null
- Dwhere Salary is not missing
57Given the SAS data sets:
WORK.ONE
Year Qtr Budget ---- --- ------ 2001 3 500 2001 4 400 2003 1 350
WORK.TWO
Year Qtr Sales ---- --- -----
2001 4 300
2002 1 600
The following SAS program is submitted: proc sql;
select TWO.*,
budget from
WORK.ONE [_insert_join_operator_] WORK.TWO
on ONE.Year=TWO.Year
; quit;
The following output is desired:
Year Qtr Sales Budget ---- --- ----- ------
2001 4 300 500 2001 4 300 400 20021600 .
. . . 350
Which join operator completes the program and generates the desired output?- Aleft join
- Bright join
- Cfull join
- Douter join
58The following SAS program is submitted:
%let Name1=Shoes; %let Name2=Clothes; %let Root=name; %let Suffix=2;
%put &&&Root&Suffix; What is written to the SAS log?- A&Name2
- BClothes
- C&&&Root&Suffix
- DWARNING: Apparent symbolic reference ROOT2 not resolved.
59The SASFILE statement requests that a SAS data set be opened and loaded into memory:
- Aone page at a time.
- Bone variable at a time.
- Cone observation at a time.
- Din its entirety, if possible.
60To create a dataset with unique values of a given variable using a data step and the FIRST. VARIABLES and LAST.VARIABLES, it is assumed that the input dataset is:
- Asorted on that variable.
- Bindexed by that variable.
- Cnaturally in order.
- Dany of the above A, B, or C
61Given the following program and data:
data WORK.BDAYINFO;
infile datalines;
input Name $ Birthday : mmddyy10.;
datalines;
Alan 11/15/1950 Barb 08/23/1966 Carl 09/01/1963 ;
run;
%let Want=23AUG1966;
proc print data=WORK.BDAYINFO;
[_insert_statement_] run;
What is the WHERE statement that successfully completes the PROC PRINT and selects the observation for Barb?- Awhere Birthday=&Want;
- Bwhere Birthday="&Want";
- Cwhere Birthday="&Want"d;
- Dwhere Birthday='&Want'd;
Information
- Description
- SAS Statistics Quiz on Crackman ADV 63, created by Fiona Yang on 06/01/2017.
- Author
- Fiona Yang
- Language
- English
- Views
- 206
- Tags
- Rating
- No ratings yet Rate this quiz