Recently update Advance SAS Certification Question
Option to control input output
Ans . busize and buffno
The following SAS program is submitted:
%macro execute;
Proc print data= sasuser.houses;
Run;
<insert here>
%end;
%mend;
%execute
Which statement completes the program so
that it executes on Tuesday?
a) %if
&sysday=Tuesday %then %do;
b) %if &sysday=’Tuesday’ %then %do;
c) %if &sysdate= Tuesday %then %do;
d) %if &sysdate=’Tuesday’ %then %do;
Assume
today is Tuesday, August 15, 2006. Which statement, submitted at the beginning
of a SAS session, assigns the value Tuesday, August 15, 2006 to the macro
variable START?
a)
%let start= %eval(today(), weekdate.);
b) %let start= %sysfunc(today(),
weekdate.);
c)
%let start= %sysexec(today(), weekdate.);
d)%let
start= %sysevalf(today(), weekdate.);
The
following program is submitted:
%let value=0.5;
%let add=5;
%let newwval=%eval(&value+&add);
What is the value of the macro variable
NEWVAL?
a)
5
b)
5.5
c)0.5+5
d) null
The
SAS data set ONE has a variable X on which an index has been created. The data
sets ONE and THREE are sorted by X.
The following SAS program is submitted:
Data two;
Set three;
Set one
key=X;
Run;
What
is the purpose of including the KEY= option in the program?
a) It forces SAS to use the index
X.
b)
It re-creates the index X on the output data set TWO.
c)
It instructs SAS to do a sequential read of both sorted data sets.
d)
It gives SAS the option to use the index X or to do a sequential read of the
data set ONE.
The
following SAS program is submitted:
Data new(bufsize=6144 bufno=4);
Set old;
Run;
What
is the difference between usage of BUFSIZE= AND
BUFNO= options?
a)
BUFSIZE= specifies the size of the input buffer in bytes; BUFNO= specifies the
number of input buffers.
b) BUFSIZE= specifies the size of
the output buffer in bytes; BUFNO= specifies the number of output buffers.
c)
BUFSIZE= specifies the size of the input buffer in kilobytes; BUFNO= specifies
the number of input buffers.
d)
BUFSIZE= specifies the size of the output buffer in kilobytes; BUFNO= specifies the number of output buffers.
Given
the data set SASHELP.CLASS:
SASHELP.CLASS
NAME
AGE
-------
------
Mary 15
Philip
16
Robert
12
Ronald
15
The following
SAS program is submitted:
%let
value = Philip;
proc
print data = sashelp.class;
<insert
WHERE statement here>
run;
Which
WHERE statement successfully completes the program and produces a report?
a) where
upcase(name) = upcase(&value);
b) where
upcase(name) = %upcase(&value);
c) where
upcase(name) = "upcase(&value)";
d)
where
upcase(name) = "%upcase(&value)";
The following SAS program
is submitted:
data combine;
merge one two;
by id;
run;
Which SQL procedure
program produces the same results?
A. proc sql;
create table combine as
select coalesce(one.id, two.id) as id,
name,
salary
from one full join two
on one.id = two.id;
quit;
B. proc sql;
create table combine as
select one.id,
name,
salary
from one inner join two
on one.id = two.id;
quit;
C. proc sql;
create table combine as
select coalesce(one.id,
two.id) as id,
name,
salary
from one, two
where one.id = two.id;
quit;
D. proc sql;
create table combine as
select one.id,
name,
salary
from one full join two
where one.id = two.id;
quit;
Given the SAS data sets
CLASS1 and CLASS2:
CLASS1 CLASS2
NAME COURSE NAME COURSE
-------- -----------
-------- ------------
Lauren MATH1 Smith MATH2
Patel MATH1 Farmer MATH2
Chang MATH1 Patel MATH2
Hillier MATH2
The following SAS program
is submitted:
proc sql;
select name from CLASS1
<insert SQL set
operator here>
select name from CLASS2;
quit;
The following output is
desired:
NAME
--------
Chang
Lauren
Which SQL set operator
completes the program and generates the desired output?
A. UNION
B. EXCEPT
C. INTERSECT
D. OUTER UNION CORR
The following SAS program is
submitted:
%macro loop;
data one;
%do I = 1 %to 3;
var&I = &i; %
end;
run;
%mend;
%loop
After this program executes, the
following is written to the SAS log:
(LOOP): Beginning execution.
(LOOP): %DO loop beginning; index
variable I; start value is 1; stop value is 3; by value is 1.
(LOOP): %DO loop index variable I is
now 2; loop will iterate again.
(LOOP): %DO loop index variable I is
now 3; loop will iterate again.
(LOOP): %DO loop index variable I is
now 4; loop will not iterate again.
(LOOP): Ending execution.
Which SAS System option displays the
notes in the SAS log?
A. MACRO
B.
MLOGIC
C. MPRINT
D. SYMBOLGEN
The following SAS program
is submitted:
data temp;
array points{2,3} (10, 15,
20, 25, 30, 35);
run;
What impact does the ARRAY
statement have in the Program Data Vector (PDV)?
A. The variables named POINTS1, POINTS2, POINTS3, POINTS4,
POINTS5, POINTS6 are
created in the PDV.
B. The variables named
POINTS10, POINTS15, POINTS20, POINTS25, POINTS30, POINTS35
are created in the PDV.
C. The variables named
POINTS11, POINTS12, POINTS13, POINTS21, POINTS22, POINTS23
are created in the PDV.
D. No variables are
created in the PDV.
Which SAS integrity
constraint type ensures that a specific set or range of values are the only
values in a variable?
A. CHECK
B. UNIQUE
C. NOT NULL
D. PRIMARY KEY
The following SAS program is
submitted:
data new (bufsize = 6144 bufno = 4);
set old;
run;
What is the difference between the
usage of BUFSIZE= and BUFNO= options?
A. BUFSIZE= specifies the size of the
input buffer in bytes; BUFNO= specifies the number of
input buffers.
B.
BUFSIZE= specifies the size of the output buffer in bytes; BUFNO= specifies the
number of
output
buffers.
C. BUFSIZE= specifies the size of the input
buffer in kilobytes; BUFNO= specifies the number of
input buffers.
D. BUFSIZE= specifies the size of the
output buffer in kilobytes; BUFNO= specifies the number of
output buffers.
The following SAS program is
submitted:
%let first = yourname;
%let last = first;
%put &&&last;
What is written to the SAS log?
A. First
B. &&first
C.
yourname
D. &yourname
Given the following SAS
data set ONE:
ONE
REP COST
________________________
SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
JONES 200
JONES 400
SMITH 800
JONES 100
JONES 300
The following SAS program
is submitted:
proc sql;
select rep, avg(cost) as
AVERAGE
from one group by rep
having avg(cost) >
(select avg(cost) from one);
quit;
Which one of the following
reports is generated?
A. REP AVERAGE
_______________
JONES 200
B. REP AVERAGE
_________________
JONES 320
C. REP AVERAGE
________________
SMITH 320
D. REP AVERAGE
________________
SMITH 500
The following SAS program
is submitted:
%let value = 9;
%let value2 = 5;
%let newval =
%eval(&value / &value2);
Which one of the following
is the resulting value of the macro variable NEWVAL?
A. 1
B. 2
C. 1.8
D. null
The SAS data set ONE has a
variable X on which an index has been created. The data sets ONE
and THREE are sorted by X.
Which one of the following SAS programs uses the index to select
observations from the data
set ONE?
A. data two;
set three;
set one key = X;
run;
B. data two;
set three key = X;
set one;
run;
C. data two;
set one;
set three key = X;
run;
D. data two;
set three;
set one (key = X);
run;
The following SAS program
is submitted:
proc sql;
select rep, area, count(*)
as TOTAL
from one group by rep,
area;
quit;
Which one of the following
reports is generated?
A. REP AREA COUNT
-----------------------------------------------
JONES EAST 100
JONES NORTH 600
JONES WEST 500
SMITH NORTH 800
SMITH SOUTH 200
B. REP AREA TOTAL
-----------------------------------------------
JONES EAST 100
JONES NORTH 600
JONES WEST 500
SMITH NORTH 800
SMITH SOUTH 200
C. REP AREA TOTAL
-----------------------------------------------
JONES EAST 1
JONES NORTH 2
JONES WEST 3
SMITH NORTH 3
JONES WEST 3
SMITH NORTH 3
SMITH SOUTH 1
D. REP AREA TOTAL
-----------------------------------------------
JONES EAST 1
JONES NORTH 2
JONES WEST 3
SMITH NORTH 3
SMITH SOUTH 1
SMITH NORTH 3
SMITH SOUTH 1
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:
%macro execute;
<insert statement here>
proc print data = sasuser.houses;
run;
%end;
%mend;
Which of the following completes the
above program so that it executes on Tuesday?
A. %if
&sysday = Tuesday %then %do;
B. %if &sysday = 'Tuesday' %then
%do;
C. %if "&sysday" =
Tuesday %then %do;
D. %if '&sysday' = 'Tuesday' %then
%do;
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 displays the value of a macro variable in the SAS log?
A. MACRO
B. SOURCE
C. SOURCE2
D. SYMBOLGEN
What is the correct syntax
to create macro variable with sql?
Select distinct country into:cur seprated by ‘ ’ from tablename
The following SAS program is
submitted:
options yearcutoff = 1950;
%macro y2kopt(date);
%if &date >= 14610 %then %do;
options yearcutoff = 2000;
%end;
%else %do;
options yearcutoff = 1900;
%end;
%mend;
data _null_ ;
date = "01jan2000"d;
call
symput("date",left(date));
run;
%y2kopt(&date)
The SAS date for January 1, 2000 is
14610 and the SAS system option for YEARCUTOFF is set
to 1920 prior to submitting the above
program. Which one of the following is the value of
YEARCUTOFF when the macro finishes
execution?
A. 1900
B. 1920
C. 1950
D. 2000
Check the symtax what will
happn when we submit this program.
Data aa ;
Length x y 5 z ;
Run ;
Data set will not created.
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
Given the following SAS
data set ONE:
ONE
LEVEL AGE
----------------------
1 10
2 20
3 20
2 10
1 10
2 30
3 10
2 20
3 30
1 10
The following SAS program
is submitted:
proc sql;
select level, max(age) as
MAX
from one
group by level
having max(age) >
(select avg(age) from one);
quit;
Which one of the following
reports is generated?
A. LEVEL AGE
-------------------
2 20
3 20
B. LEVEL AGE
---------------
2 30
3 30
C. LEVEL MAX
--------------------
2 20
3 30
D. LEVEL MAX
--------------
2 30
3 30.
The following SAS program
is submitted.
filename sales
('external-file1' 'external-file2');
data new;
infile sales;
input date date9. company
$ revenue;
run;
Which one of the following
is the result of including the FILENAME statement in this program?
A. The FILENAME statement
produces an ERROR message in the SAS log.
B. The FILENAME statement
associates SALES with external-file2 followed by external-file1.
C. The FILENAME statement associates SALES with external-file1
followed by external-file2.
D. The FILENAME statement
reads record 1 from external-file 1, reads record 1 from external-file
2, and combines them into
one record
Which technique is use to
find the unique value from a data sets?
First. And last.by
Proc sql unique
Proc sort
Where we can’t use not
sorted option ?
Merge
Code
C
M
A
R
P
Proc print data = dataset
name ;
By code;
Run ;
No output will print.
Which statement is use to
write data in a file ;
File statement
What option will display
macro code and macro execution details in log window?
Mlogic and mprint
Data step with view ;
When msg will come to log
; ;