Sunteți pe pagina 1din 38

PROG1 Chapter 2:

Objective: (1.2.1) State components of a SAS program


Item: 1
Which of the following are the 2 steps a SAS Program consists of?
A. PROC and DATA steps
B. OPTION and DATA steps
. O!TP!T and DATA steps
D. P"O#SS and DATA steps
Item: 2
Which of the following is the $asic component of a step?
A. Options
B. %&nctions
. Processes
D. Statements
Item: 3
The following program e'ec&tes(
data work.staf;
infle 'raw-data-fle';
input LastName $ 1-20
FirstName $ 21-30
Jo!itle $ 3"-#3
$alar% &#-&';
pro( print data)work.staf;
run;
)ow man* program steps are e'ec&ted?
A. 2
B. +
. ,
D. 5
Item: 4
)ow man* statements does the first step of the following SAS Program contain?
data work.staf;
infle 'raw-data-fle';
input LastName $ 1-20
FirstName $ 21-30
Jo!itle $ 3"-#3
$alar% &#-&';
pro( print data)work.staf;
run;
A. 3
B. ,
. -
D. .
Item: 5
Which of the following statements are seen as Step Boundaries?
A. "&n/ 0&it and #nd
B. "&n/ #'it and 0&it
. "&n/ #nd/ DATA and P"O
D. Run, Quit, DATA and PROC
Item:
Which of the following are the 2 components that a SAS Data Set consists of?
A. Proc step and Data step
B. Info portion and Data step
. Des!ript"r p"rti"n and Data p"rti"n
D. Descriptor portion and 1al&e portion
Item: #
Which of the following statements are contained in the step $elow?
options nodate;
data work.staf;
infle 'raw-data-fle';
input LastName $ 1- 20
2
FirstName $ 21-30
Jo!itle $ 3"-#3
$alar% &#-&';
run;
A. Data and "&n
B. Options/ Data and "&n
. Data/ Infile/ Inp&t and "&n
D$ Opti"ns, Data, In%i&e, Input and Run
Item: 1$2$1$h$1
8
)ow man* 2aria$les and o$ser2ations does the Data Set $elow contain?
A. 4 'aria(&es, 5 "(ser'ati"ns
B. - 2aria$les/ , o$ser2ations
. , 2aria$les/ . o$ser2ations
D. an3t tell $eca&se some 2al&es are missing.
Item: 1$2$1$i$1
)
Defa&lt settings pro2ided/ what t*pe of 2aria$le is the 2aria$le Salary in the data set $elow?
A. N&meric
B. Chara!ter
. an3t tell from data shown
D. #ither N&meric or haracter
3
Objective: (1.2.2) Explain SAS Syntax Rles
Item: 1$2$2$a$1
1*
What does a statement &s&all* $egin with?
A. omment
B. DATA step
. 1aria$le Name
D. Identif*ing 4e*word
Item: 1$2$2$($1
11
What does a statement end with?
A. olon 5(6
B. Period 5.6
. omma 5/6
D. Semi+!"&"n ,-.
Item: 1$2$2$!$1
12
Which of the following statements are tr&e?
SAS statements...
I. m&st $egin in ol&m 7.
II. can span se2eral lines.
III. can contain m&ltiple $lan4s.
A. I. and II. onl*
B. I. and III. onl*
. II. and III. onl*
D. I$, II$ and III$
4
Objective: (1.2.!) "#y $o %e nee$ SAS &ata Sets'
Item: 1$2$3$a$1
13
In what form m&st data $e/ to $e processed $* most SAS proced&res?
A. #'ternal %ile
B. Spreadsheet
. SAS Data Set
D. A&& "% the a("'e
Objective: (1.2.() State t#e naming conventions for $ata sets an$ variables
Item: 1$2$4$a$1
14
Which of the following is a 2alid 2aria$le name within SAS?
A. /'a&id'aria(&ename
B. 2alid82aria$lename
. -2alid2aria$lename
D. 92alid 2aria$le name
Item: 1$2$4$($1
15
Which of the following is a 2alid name for SAS data sets?
A. Wor4.8staff
B. 0"r1$1sta%%
. Wor4.9Staff
D. Wor4.staff.set
Item: 1$2$4$!$1
1
What is %A:S# regarding SAS data set and 2aria$le names?
A. The* can $e mi'ed case.
5
B. The* can $e &p to +24 in length.
. The* m&st start with letter or &nderscore.
D. The2 !an ha'e num(ers %r"m p"siti"n 2 "n3ards$
Objective: (1.2.)) *$entifying missing $ata vales
Item: 1$2$5$a$1
1#
Which of the following correctl* descri$es how missing 2al&es are displa*ed for the two t*pes of 2aria$les in
SAS?
A. haracter( Dot
N&meric( Dot
B. Chara!ter: 4&an1
5umeri!: D"t
. haracter( Dot
N&meric( Blan4
D. haracter( Blan4
N&meric( Blan4
Objective: (1.2.+) *$entifying syntax errors
Item: 1$2$$a$1
16
)ow man* s*nta' errors are in the following step?
daat work.staf;
infle 'raw-data-fle';
input LastName $ 1-20
FirstName $ 21-30
Jo!itle $ 3"-#3
$alar% &#-&';
pro( print data)work.staf
run;
A. ;
B. 1
. 2
D. +
6
Objective: (1.2.,) -avigate t#e SAS %in$o%ing environment
Item: 1$2$#$a$1
1)
Which of the following are the windows that are accessi$le for SAS &sers d&ring program de2elopment?
A. Program #ditor/ :og and "es&lts
B. Pr"7ram 8dit"r, Output and 89p&"rer
. Program #ditor/ #'plorer and "es&lts
D. P<=/ :og/ O&tp&t/ "es&lts and #'plorer
Item: 1$2$#$($1
2*
Which of the following SAS windows is &sed to enter/ change and s&$mit SAS programs?
A. :og
B. O&tp&t
. "es&lts
D. Pr"7ram 8dit"r
Item: 1$2$#$!$1
21
Which of the following SAS windows is &sed to 2iew messages a$o&t *o&r SAS session?
A. :"7
B. O&tp&t
. "es&lts
D. Program #ditor
Item: 1$2$#$d$1
22
Which of the following SAS windows is &sed to $rowse res&lts from SAS programs?
A. :og
B. Output
. #'plorer
D. Program #ditor
7
Item: 1$2$#$e$1
23
Which of the following editors can $e &sed to modif* e'isting SAS programs?
I. Notepad
II. =icrosoft Word
III. The SAS Program #ditor
A. I. onl*
B. I. and II. onl*
. I$ and III$ "n&2
D. I./ II. and III.
8
PROG1 Chapter 3:
Objective: (1.!.1) State t#e $ifference bet%een permanent an$ temporary
libraries
Item: 1$3$1$a$1
24
Which of the following is a correct wa* of addressing temporar* data sets within SAS data steps?
I. Temp
II. Wor4.Temp
III. Temp.Temp
A. I$ and II$ "n&2
B. I. and III. onl*
. II.and III. onl*
D. I./II. and III.
Objective: (1.!.2) Explain t#e .oncepts of a SAS $ata library
Item: 1$3$2$a$1
25
What is a SAS data li$rar*?
I. A collection of SAS files/ s&ch as SAS data sets and catalogs
II. In some operating en2ironments/ a ph*sical collection of SAS files
III. In some operating en2ironments/ a logicall* related collection of SAS files
A. I. and II. onl*
B. I. and III. onl*
. II. and III. onl*
D. I$, II$ and III$
Item: 1$3$2$($1
2
Which of the following statements assigns a li$ref to a SAS data li$rar*?
A. :I45A;8 &i(re% <SAS+data+&i(rar2<-
B. :IBNA=# 3SAS>data>li$rar*3 li$ref?
. :IBNA=# @ li$ref 3SAS>data>li$rar*3?
9
D. :IBNA=# li$ref @ 3SAS>data>li$rar*3?
Item: 1$3$2$!$1
2#
What is the defa&lt name for the temporar* SAS li$rar*?
A. 0"r1
B. Temp
. Sas&ser
D. Saswor4
Objective: (1.!.!) State t#e $ifference bet%een permanent an$ temporary
libraries
Item: 1$3$3$a$1
26
Which of the following files is a permanent SAS file?
I. Sales.sales
II. Sashelp.sales
III. Sas&ser.sales
A. I. onl*
B. II. onl*
. III. onl*
D. I$, II$ and III$
Item: 1$3$3$($1
2)
Which of the following data set names descri$es a temporar* SAS file?
A. Sa&es
B. Temp.sales
. Sas&ser.sales
D. Saswor4.sales
10
Objective: (1.!.() *nvestigation of $ata libraries
Item: 1$3$4$a$1
3*
Which of the following proced&res can $e &sed to in2estigate the mem$ers of a SAS data li$rar*?
A. :IST proced&re
B. 1I#W proced&re
. PRI5T pr"!edure
D. ONT#NTS proced&re
Item: 1$3$4$($1
31
Which of the following proced&res can $e &sed to in2estigate the descriptor portion of a SAS data set?
A. :IST proced&re
B. 1I#W proced&re
. P"INT proced&re
D. CO5T85TS pr"!edure
Item: 1$3$4$!$1
32
Which of the following statements prints a s&mmar* of all files stored in the li$rar* named Sales?
A. proc contents data @ sales9A::9 nods?
r&n?
B. proc contents data @ sales.9A::9 nods?
r&n?
. proc contents data @ sales 9A::9.nods?
r&n?
D$ pr"! !"ntents data = sa&es$/A::/ n""(s-
run-
11
PROG1 Chapter 4:
Objective: (1.(.1) /enerate simple list reports sing 0R*-1 proce$re
Item: 1$4$1$a$1
33
<i2en the dataset flights.schedule/ which of the following P"INT proced&re steps creates the o&tp&t $elow?
A. pro( print data)*i+,ts.s(,edule noos;
-ar on (,an+ed *i+,t;
w,ere on .) 1"0;
run;
B. pro( print data)*i+,ts.s(,edule ;
-ar date on (,an+ed *i+,t;
w,ere (,an+ed . 3;
run;
12
C$ proc print data=fights.schedule label;
id date;
var boarded transferred fight;
label boarded = 'On'
transferred = 'Changed';
where fight = '219';
run;
D. pro( print data)*i+,ts.s(,edule noos;
id date;
-ar date on (,an+ed *i+,t;
w,ere *i+,t ) '21'';
run;
Item: 1$4$1$($1
34
Which of the following options of the P"INT proced&re statement s&ppresses the o$ser2ations col&mn?
A$ 5OO4S
B. NOO:
. NON!=
D. NO OBS
Item: 1$4$1$!$1
35
The following step e'ec&tes(
/012 /03N! data ) ia.sales;
run;
What will $e displa*ed?
A. All 2aria$les/ all o$ser2ations with no o$ser2ations col&mn
4$ A&& 'aria(&es, a&& "(ser'ati"ns and the "(ser'ati"ns !"&umn
. All 2aria$les/ selected o$ser2ations and the o$ser2ations col&mn
D. Selected 2aria$les/ all o$ser2ations and the o$ser2ations col&mn
13
Item: 1$4$1$d$1
3
Which of the following statements in the P"INT proced&re selects which 2aria$les to print?
A. The >AR statement
B. The O: statement
. The 1A"S statement
D. The W)#"# statement
Item: 1$4$1$e$1
3#
Which of the following statements in the P"INT proced&re selects which o$ser2ations to print?
A. The OBS statement
B. The A##P statement
. The 0?8R8 statement
D. The S#:#T statement
Objective: (1.(.2) &isplay selecte$ observations in a report
Item: 1$4$2$a$1
36
Which of the following statements selects and prints onl* those o$ser2ations from a data set where the 2al&e
of the 2aria$le cartype is =#"#D#S/ )ONDA or :ANIA?
A. pro( print data ) ia. sales;
w,ere (art%pe ) '4502565$' or '71N68' or 'L8N238';
run;
B. pro( print data ) ia. sales;
w,ere (art%pe in '4502565$' or '71N68' or 'L8N238';
run;
. pro( print data ) ia. sales;
w,ere (art%pe in 94502565$: 71N68: L8N238;;
run;
D. proc print data = ia. sales;
where cartype in '!"#C"$"%'& ''O($)'& '*)(C+)',;
run;
Item: 1$4$2$($1
3)
Which of the following steps selects and prints onl* those o$ser2ations from a data set where the 2al&e of the
2aria$le cartype is =#"#D#S/ )ONDA or :ANIA?
14
A. pro( print data ) ia. sales;
w,ere (art%pe in 9'4er(edes': '7onda': 'Lan(ia';;
run;
B. pro( print data ) ia. sales;
w,ere (art%pe in 9'4502565$': '71N68': 'L8N238';;
run;
. proc print data = ia. sales;
where cartype in '-ercedes'& 'honda'& 'lancia',;
run;
D. pro( print data ) ia. sales;;
w,ere (art%pe ) '4502565$' or '71N68' or 'L8N238';
run;
Objective: (1.(.!) &isplay a report %it# totals
Item: 1$4$3$a$1
4*
The following step e'ec&tes(
pro( print data ) ia.sales;
sum $ales;
run;
What will $e displa*ed?
A. S&$totals onl*
B. Grandt"ta& "n&2
. S&$totals and grandtotal
D. No grandtotal or s&$totals
Item: 1$4$3$($1
41
The following step e'ec&tes(
pro( print data ) ia.sales;
% 6i-;
sum $ales;
run;
What will $e displa*ed?
A. S&$totals onl*
B. <randtotal onl*
. Su(t"ta&s and 7randt"ta&
15
D. No grandtotal or s&$totals
Objective: (1.(.() &isplay selecte$ observations in a report
Item: 1$4$4$a$1
42
The following step e'ec&tes(
pro( print data ) ia.sales;
w,ere sales etween 20000 and 30000;
run;
What range of 2al&es will $e selected?
A. All 2al&es $etween and incl&si2e of 2;;;; and +;;;;.
B. A&& 'a&ues (et3een and e9!&usi'e "% 2**** and 3****$
. All 2al&es $etween 2;;;; and +;;;; e'cl&ding 2;;;;/ incl&ding +;;;;.
D. All 2al&es $etween 2;;;; and +;;;; incl&ding 2;;;;/ e'cl&ding +;;;;.
Item: 1$4$4$($1
43
Which of the following steps selects and prints rows in which

The 2aria$le salary is greater than -;;;; and
EmpNum is 3#+;;,3 or country is 3So&th Africa3?
A$ proc print data = ia.salaries;
where salary . /0000 and "-p(u- = '"1002' or country = '%outh )frica',;
run;
B. pro( print data ) ia.salaries;
w,ere salar% . &0000 or 5mpNum ) '5300#' and (ountr% ) '$out, 8<ri(a';
run;
. pro( print data ) ia.salaries;
w,ere 9salar% . &0000 and 5mpNum ) '5300#'; or (ountr% ) '$out, 8<ri(a';
run;
D. pro( print data ) ia.salaries;
w,ere salar% . &0000 and 5mpNum ) '5300#' or (ountr% ) '$out, 8<ri(a';
run;
16
Objective: (1.(.)) 0rinting labels on reports
Item: 1$4$5$a$1
44
A la$el is to $e printed for the 2aria$le div.
Which of the following P"O P"INT steps is correct pro2ided that no la$els are associated with an* of the
2aria$les?
A. proc print data = ia.sales label;
label div = 3$ivision3;
run;
B. pro( print data ) ia.sales;
lael di- ) =6i-ision=;
run;
. pro( print data ) ia.sales split ) ' ';
run;
D. pro( print data ) ia.sales lael;
run;
Item: 1$4$5$($1
45
A la$el is to $e printed for the 2aria$le div.
Which of the following P"INT proced&re steps is correct pro2ided that no la$els are associated with an* of the
2aria$les?
A$ proc print data = ia.sales label;
run;
B. pro( print data ) ia.sales split ) ' ';
run;
. pro( print data ) ia.sales;
lael di- ) =6i-ision=;
run;
D. pro( print data ) ia.sales split ) ' ';
lael di- ) =6i-ision=;
run;
17
Objective: (1.(.+) Sort observations in SAS $ata sets
Item: 1$4$$a$1
4
What is %A:S# regarding the SO"T proced&re?
A. It can sort on m&ltiple 2aria$les.
B. It does not generate printed o&tp&t.
. It sorts in ascending order $* defa&lt.
D. It a&3a2s "'er3rites the e9istin7 SAS data set.
Item: 1$4$$($1
4#
What is T"!# regarding the SO"T proced&re?
A. It ignores missing 2al&es.
B. It generates printed o&tp&t.
. It alwa*s creates a new data set.
D. It d"es n"t 7enerate printed "utput$
Item: 1$4$$!$1
46
The following steps e'ec&te(
pro( sort data ) ia.o>(es;
% o>(e dept;
run;
pro( print data ) ia.o>(es noos;
run;
Which of the following o&tp&ts is the res&lt?
A.
4$
.
D.
O%%i!e Dept
PT Admin
Training
BNB Admin
Sales
Training
O%%i!e Dept
PT Admin
PT Training
BNB Admin
BNB Sales
BNB Training
O%%i!e Dept
PT Admin
BNB Admin
BNB Sales
PT Training
BNB Training
O%%i!e Dept
7 PT Admin
2 PT Training
+ BNB Admin
, BNB Sales
- BNB Training
18
Item: 1$4$$d$1
4)
The following steps e'ec&te(
pro( sort data ) ia.o>(es;
% des(endin+ o>(e dept;
run;
pro( print data ) ia.o>(es noos;
run;
Which of the following o&tp&ts is the res&lt?
A.
B.
.
D$
Item: 1$4$$e$1
5*
What form sho&ld the data $e in when &sing the $*>statement?
A. Data can $e in an* form.
B. Data sho&ld $e in &nsorted order.
. Data sho&ld $e sorted on an* 2aria$le.
D. Data sh"u&d (e s"rted "n the 'aria(&e used in the (2+statement$
PROG1 Chapter 5:
Objective: (1.).1) &efine titles an$ footnotes to en#ance reports
Item: 1$5$1$a$1
51
Which of the following statements are tr&e?
I. Titles appear at the top of the page.
II. The n&ll title statement 3TIT:#3 cancels all titles.
III. An &nn&m$ered title statement is eC&i2alent to 3TIT:#73.
A. I. and II. onl*
B. I. and III. onl*
. II. and III. onl*
D. I$, II$ and III$
O%%i!e Dept
BNB Admin
Sales
Training
PT Admin
Training
O%%i!e Dept
BNB Admin
BNB Sales
BNB Training
PT Admin
PT Training
O%%i!e Dept
BNB Admin
Sales
Training
PT Admin
Training
O%%i!e Dept
BNB Training
BNB Sales
BNB Admin
PT Training
PT Admin
19
Item: 1$5$1$($1
52
The following code is s&$mitted(

pro( print data ) ia.(ustomers;
!itle1 'First title';
!itle2 '$e(ond title';
!itle3 '!,ird title';
!itle2 '0epla(ed title';
run;
What will the order of the res&lting titles $e?
A. 3"eplaced title3
B. 3%irst title3
3"eplaced title3
C$ 3%irst title3
3"eplaced title3
3Third title3
D. 3%irst title3
3Second title3
3Third title3
3"eplaced title3?
Item: 1$5$1$!$1
53
Which of the following statements regarding footnotes is tr&e?
A. A defa&lt footnote is printed.
B. A ma'im&m of - footnotes can $e specified.
. 5" %""tn"te is printed un&ess "ne is spe!i%ied$
D. %ootnotes remain in effect onl* for the d&ration of the step.
Objective: (1.).2) 2sing SAS System options
Item: 1$5$2$a$1
Which of the following statements are tr&e?
54
The OPTIONS statement can $e &sed...
I. $etween steps.
II. in the DATA step.
III. in the P"O step.
A. I. and II. onl*
B. I. and III. onl*
. II. and III. onl*
D. I$, II$ and III$
20
Item: 1$5$2$($1
55
Which of the following options specifies that page n&m$ers are printed?
A. PAG85O
B. N!=B#"
. PA<#NO @ 7
D. PA<#N!=B#"
Item: 1$5$2$!$1
5
Which of the following options specifies that page n&m$ers are NOT printed?
A. 5O5@;48R
B. PA<#NO @ 7
. N!=B#" @ NO
D. PA<#NO @ NO
Item: 1$5$2$d$1
5#
The following step e'ec&tes(
pro( print data ) ia.(ustomers;
options date nonumer pa+eno ) 1;
run;
What will $e displa*ed in the o&tp&t?
A. The date "n&2
B. The pagen&m$ers onl*
. No date and no pagen&m$ers
D. The date and the pagen&m$ers
Objective: (1.).!) &isplay formatte$ vales sing SAS formats in a list report
Item: 1$5$3$a$1
56
)ow can a format $e applied to a specific SAS 2aria$le?
A. B* &sing the %O"=AT option.
B. B* &sing the %O"=AT command.
. 42 usin7 the AOR;AT statement$
D. B* &sing the %O"=AT proced&re.
Item: 1$5$3$($1
5)
Which of the following steps correctl* applies the ddmm**7;. format to the hiredate 2aria$le?
A. pro( print data ) ia.emplo%ees;
<ormat ,iredate ddmm%%10;
run;
21
B. pro( print data ) ia.emplo%ees;
<ormat ddmm%%10 7iredate;
run;
. proc print data = ia.e-ployees;
for-at hiredate dd--yy10.;
run;
D. pro( print data ) ia.emplo%ees;
<ormat ddmm%%10. ,iredate;
run;
Item: 1$5$3$!$1
*
Which of the following steps permanentl* assigns the commaD.2 format to the salary 2aria$le?
A. pro( print data ) new;
<ormat salar% (omma?.2;
run;
B. data new;
set old;
for-at salary co--a4.2;
run;
. data new;
infle 'raw-data';
input salar% (omma?.2;
run;
D. pro( print data ) new;
infle 'raw-data';
input salar% (omma?.2;
run;
Item: 1$5$3$d$1
1
Which of the following steps temporaril* assigns the commaD.2 format to the salary 2aria$le?
A$ proc print data = new;
for-at salary co--a4.2;
run;
B. data new;
set old;
<ormat salar% (omma?.2;
run;
. data new;
infle 'raw-data';
input salar% (omma?.2;
run;
D. pro( print data ) new;
infle 'raw-data';
input salar% (omma?.2;
run;
Item: 1$5$3$e$1
2
The E.. format is applied to Var1 = 'John Doe'.
What is the res&lt?
22
A. Bohn
B. B"hn D
. hn Doe
D. Bohn Doe
Item: 1$5$3$%$1
3
The character format "#<ION was created in a %O"=AT proced&re.
Which of the following %O"=AT statements will appl* it to the 2aria$le eg!ode in the program o&tp&t?
A. <ormat 0e+2ode re+ion;
B. <ormat 0e+2ode $re+ion;
. <ormat 0e+2ode re+ion.;
D. for-at #egCode 5region.;
Item: 1$5$3$7$1
4
The format dept was created in a %O"=AT proced&re.
Which of the following %O"=AT statements will appl* it to the 2aria$le Department in the program o&tp&t?
A. <ormat 6epartment dept;
B. for-at $epart-ent dept.;
. <ormat 6epartment ) dept.;
D. <ormat 6epartment ) =dept=;
Item: 1$5$3$h$1
5
Which of the following %O"=AT proced&res is correct?
A. proc for-at;
value dressf-t 0 = '+nfor-al' 1 = '6or-al';
run;
B. pro( <ormat -alue dress<mt;
0 ) '3n<ormal' 1 ) 'Formal';
run;
. pro( <ormat;
-alue dress<mt 0 ) '3n<ormal';
1 ) 'Formal';
run;
D. pro( <ormat;
-alue dress<mt;
0 ) '3n<ormal' 1 ) 'Formal';
run;
Item: 1$5$3$i$1

A format is created &sing the 1A:!# statement.


Which of the following statements is tr&e?
A. The new format3s name can end with a n&m$er.
23
B. The new format3s name m&st end with a period.
. The new format3s name m&st $e at least eight characters in length.
D. The ne3 %"rmat<s name must (e7in 3ith a d"&&ar si7n ,C. i% used 3ith a !hara!ter 'aria(&e.
Objective: (1.).() 2sing t#e Otpt &elivery System (O&S)
Item: 1$5$4$a$1
#
ODS creates lin4s to o&tp&t in the res&lts window and &ses icons to identif* o&tp&t o$Fects.
What happens if $oth/ listing o&tp&t and )T=: o&tp&t are created for the same proced&re?
A. Onl* a listing o&tp&t icon is displa*ed.
B. Onl* an )T=: o&tp&t icon is displa*ed.
. :istin7 and ?T;: "utput i!"ns are disp&a2ed$
D. An error message is generated in the SAS log.
Item: 1$5$4$($1
6
What is the p&rpose of closing the listing destination in the code shown $elow?
@...A
ods listin+ (lose;
ods ,tml ...;
@...A
A. It simplifies the program.
B. It !"nser'es s2stem res!"ur!es$
. It ma4es the program compati$le with other hardware platforms.
D. It ma4es the program compati$le with pre2io&s 2ersions of SAS software.
PROG1 Chapter :
Objective: (1.+.1) .reate a SAS &ata set from ra% $ata
Item: 1$$1$a$1
)
A SAS data set is created from a raw data file.
Which of the following areas are created in memor* d&ring compilation?
I. The Program Data 1ector
II. The Inp&t B&ffer
III. The Program #ditor
A. I$ and II$ "n&2
B. I. and III. onl*
. II. and III. onl*
D. I./ II. and III.
24
Item: 1$$1$($1
#*
A SAS data set is created from an e'isting SAS data set.
Which of the following areas are created in memor* d&ring compilation?
I. The Inp&t B&ffer
II. The Program #ditor
III. The Program Data 1ector
A. I. onl*
B. III$ "n&2
. I. and II. onl*
D. I. and III. onl*
Objective: (1.+.2) .reating SAS $ata sets
Item: 1$$2$a$1
#1
The following DATA step e'ec&tes(
data ia.(odes;
infle 'raw-data';
input 3dNum $ 1& - 1'
Jo(ode $ 1 - 10
6es(ription $ 20 - 30
$alar% 31 - 3&;
Bonus ) $alar% C .10;
run;
In what order will the 2aria$les $e stored in the new data set?
A. 7. Bon&s
2. IdN&m
+. Bo$code
,. Description
-. Salar*
4$ 7. IdN&m
2. Bo$code
+. Description
,. Salar*
-. Bon&s
. 7. Bon&s
2. Bo$code
+. IdN&m
,. Description
-. Salar*
D$ 7. Bo$code
2. IdN&m
25
+. Description
,. Salar*
-. Bon&s
Item: 1$$2$($1
#2
The following DATA step e'ec&tes(
data ia.(odes;
infle 'raw-data';
len+t, Bonus ';
input 3dNum $ 1&-1'
Jo(ode $ 1-10
6es(ription $ 20-30
$alar% 31-3&;
Bonus ) $alar% C .10;
run;
In what order will the 2aria$les $e stored in the new data set?
A. 7. IdN&m
2. Bo$code
+. Description
,. Salar*
-. Bon&s
B. 7. Bon&s
2. Bo$code
+. IdN&m
,. Description
-. Salar*
. 7. Bo$code
2. IdN&m
+. Description
,. Salar*
-. Bon&s
D. 7. Bon&s
2. IdN&m
+. Bo$code
,. Description
-. Salar*
Item: 1$$2$!$1
#3
Which of the following statements is correct?
ol&mn inp&t is appropriate for reading G
I. data in fi'ed col&mns.
II. standard and nonstandard data.
III. calender 2al&es to $e con2erted to SAS date 2al&es.
26
A$ I. onl*
B. II. onl*
. III. onl*
D. I./ II. and III.
Item: 1$$2$d$1
#4
Which of the following statements is correct?
%ormatted inp&t is appropriate for reading G
I. data in fi'ed col&mns.
II. standard and nonstandard data.
III. calender 2al&es to $e con2erted to SAS date 2al&es.
A. I. onl*
B. II. onl*
. III. onl*
D. I$, II$ and III$
Item: 1$$2$e$1
#5
At the start of DATA step processing/ d&ring the compilation phase/ 2aria$les are created in the Program Data
1ector 5PD16.
Which of the following statements a$o&t o$ser2ations is tr&e?
A. O$ser2ations are set to ;.
B. There are n" "(ser'ati"ns$
. O$ser2ations are set to missing 2al&es.
D. O$ser2ations are set to first 2al&es of first 2aria$les.
Item: 1$$2$%$1
#
At the start of DATA step processing/ d&ring the compilation phase/ 2aria$les are created in the Program Data
1ector 5PD16.
Which of the following statements a$o&t 2aria$les is tr&e?
A. 1aria$les are set to ;.
B. 1aria$les are set to $lan4 2al&es.
. >aria(&es are set t" missin7 'a&ues$
D. There are no 2aria$les created &ntil e'ec&tion.
Objective: (1.+.!) SAS &ate 3ales
Item: 1$$3$a$1
##
27
)ow will the date 37 Ban&ar* 7H.;3 $e stored in a SAS data set?
A. *
B. ;7Ban7H.;
. ;7I;7I7H.;
D. 7 Ban&ar* 7H.;
Item: 1$$3$($1
#6
)ow will the date 37 Ban&ar* 7H.;3 $e displa*ed when the mmdd**D. format is applied?
A. 7I7I7H.;
B. *1D*1D*
. ;7;77H.;
D. ;7I;7I7H.;
Objective: (1.+.() Assign attribtes to SAS variables
Item: 1$$4$a$1
#)
)ow can the la$el "nnual Salary $e permanentl* assigned to the salary 2aria$le?
A. pro( print data ) new;
lael salar% '8nnual $alar%';
run;
B. data new;
set old;
lael salar% '8nnual $alar%';
run;
. pro( print data ) new;
lael salar% ) '8nnual $alar%';
run;
D. data new;
set old;
label salary = ')nnual %alary';
run;
Item: 1$$4$($1
6*
)ow can the la$el "nnual Salary $e temporaril* assigned to the salary 2aria$le?
A. pro( print data ) new;
lael salar% '8nnual $alar%';
run;
B. data new;
set old;
lael salar% '8nnual $alar%';
run;
. proc print data = new;
label salary = ')nnual %alary';
run;
D. data new;
set old;
lael salar% ) '8nnual $alar%';
28
run;
Item: 1$$4$!$1
61
Which of the following can $e &sed to determine the length of a new 2aria$le?
I. the :#N<T) statement
II. the assignment statement
III. the length of the 2aria$le3s first 2al&e
A. I. and II. onl*
B. I. and III. onl*
. II. and III. onl*
D. I$, II$ and III$
Item: 1$$4$d$1
62
The following DATA step e'ec&tes(
data fnan(e.newloan;
set fnan(e.re(ords;
!otLoanDpa%ment;
i< (ode ) '1' t,en !%pe ) 'FiEed';
else !%pe ) 'Fariale';
len+t, t%pe $ 10;
run;
What is the length of the 2aria$le #ype that is created?
A. -
B. D
. 7;
D. It depends on the first o$ser2ation.
Item: 1$$4$e$1
63
The following DATA step e'ec&tes(
data fnan(e.newloan;
set fnan(e.re(ords;
<ormat !otLoan 10.2;
!otLoanDpa%ment;
i< (ode ) '1' t,en !%pe)'FiEed';
else !%pe ) 'Fariale';
run;
What is the length of the 2aria$le #ot$oan?
A. 6
B. 7;
. 72
D. It depends on the first o$ser2ation
29
Objective: (1.+.)) .on$itional 0rocessing
Item: 1$$5$a$1
64
A data step containing the following I%>T)#N statement e'ec&tes(
@...A
i< fnleEam .) '&
and 9resear(, ) '8' or
9proGe(t ) '8' and present ) '8';;
t,en Hrade ) '8D';
@...A
Which e'pression will $e e2al&ated first when the statement is e'ec&ted?
A. fnleEam .) '&
B. resear(, ) '8'
. pro7ect = ')' and present = ')'
D. resear(, ) '8' or 9proGe(t ) '8' and present ) '8';
Item: 1$$5$($1
65
A data step containing the following I%>T)#N statement e'ec&tes(
@...A
i< Jo2ode ) '/ilot' t,en do;
0aise ) '100I';
Bonus ) '"0I';
end;
else
raise ) '&0I';
onus ) '10I';
@...A
What will the 2al&e of Bonus $e/ if Jo%code = '&ilot'?
A. 1*E
B. .;J
. 7;;J
D. None of the a$o2e
Item: 1$$5$!$1
6
A data step containing the following I%>T)#N statement e'ec&tes(
@...A
i< Jo2ode ) '/ilot' t,en do;
0aise ) '100I';
Bonus ) '"0I';
end;
else
raise ) '&0I';
onus ) '10I';
@...A
30
What will the 2al&e of aise $e/ if Jo%code = '&ilot'?
A. -;J
B. .;J
. 1**E
D. None of the a$o2e
Item: 1$$5$d$1
6#
A data step containing the following I%>T)#N statement e'ec&tes(
@...A
i< status ) '1J' and t%pe )3
t,en (ountD1;
i< status ) '$' or a(tion ) '5'
t,en (ontrol ) '$top';
@...A
What is the res&lt of the I%>T)#N statement for the o$ser2ation shown $elow?
Stat&s T*pe o&nt Action ontrol
o4 + 72 # <o
A. o&nt @ 72
ontrol @ <o
B. o&nt @ 7+
ontrol @ <o
. C"unt = 12
C"ntr"& = St"p
D. o&nt @ 7+
ontrol @ Stop
PROG1 Chapter 7:
Objective: (1.,.1) 2sing SAS fnctions
Item: 1$#$1$a$1
66
Which of the following statements selects from a data set onl* those o$ser2ations where the 2al&e of the
2aria$le cartype is mercedes/ honda or lancia?
3. w,ere (art%pe in 9'mer(edes' ',onda' 'lan(ia';;
33. w,ere (art%pe in 9'mer(edes': ',onda': 'lan(ia';;
333. w,ere up(ase9(art%pe; in 9'4502565$': '71N68': 'L8N238';;
A. I. and II. onl*
B. I. and III. onl*
. II. and III. onl*
D. I$, II$ and III$
Item: 1$#$1$($1
6)
31
What can SAS Date %&nctions $e &sed for?
I. to create SAS date 2al&es
II. to comp&te sample statistics on dates
III. to e'tract information from SAS date 2al&es
A. I. and II. onl*
B. I$ and III$ "n&2
. II. and III. onl*
D. I./ II. and III.
Item: 1$#$1$!$1
)*
Which f&nction can $e &sed to determine whether it is =onda*/ T&esda*/ Wednesda* etc.?
A. Da*5date6
B. da*n&m5date6
. 0ee1da2,date.
D. Da*ofWee45date6
Objective: (1.7.2) !!i"#$e#t !tate$e#t!
Item: 1$#$2$a$1
)1
The following code e'ec&tes(
data work.newnums;
infle 'raw-data';
input !ens 1-2;
2ount ) 2ount D tens;
run;
What will the 2al&e of !ount $e/ after the last record is read?
A. ;
B. +;
. 72;
D. ;issin7 'a&ue
Item: 1$#$2$($1
)2
The following code e'ec&tes(
data work.newnums;
infle 'raw-data';
input !ens 1-2; 2ount D tens;
run;
What will the 2al&e of !ount $e/ after the last record of the data file $elow is read?
K>>>>L>>>>7;>>>
7;
32
2;
,;
-;
A. ;
B. +;
. 12*
D. =issing 2al&e
Item: 1$#$2$!$1
)3
The following code e'ec&tes(
data work.newnums;
infle 'raw-data';
retain 2ount 100;
input !ens 1-2;
2ount D tens;
run;
What will the 2al&e of !ount $e/ after the last record of the data file $elow is read?
K>>>>L>>>>7;>>>
7;
2;
,;
-;
A. ;
B. 22*
. 7+;
D. =issing 2al&e
Item: 1$#$2$d$1
)4
The following code e'ec&tes(
data work.newnums;
retain (ount 100;
infle 'raw-data';
input !ens 1-2;
2ount ) 2ount D tens;
run;
What will the 2al&e of !ount $e/ after the last record is read?
A. ;
B. 22;
. 7+;
D. ;issin7 'a&ue
Item: 1$#$2$e$1
)5
33
The following code e'ec&tes(
data work.newnums;
retain (ount 100;
infle 'raw-data';
input !ens 1-2;
2ount ) sum9(ount:tens;;
run;
What will the 2al&e of !ount $e/ after the last record is read?
A. ;
B. 22*
. 7+;
D. =issing 2al&e
Objective: (1.,.!) Sbsetting *4 statements
Item: 1$#$3$a$1
)
The following data step e'ec&tes(
data salar%;
set m%li.emplo%ees;
0aise ) '100I';
i< Jo2ode ) '/ilot';
0aise ) '&0I';
run;
What will the 2al&e of aise $e/ if Jo%code = '&ilot'?
A. 5*E
B. 7;;J
. This o$ser2ation will not appear in o&tp&t.
D. None of the a$o2e.
Item: 1$#$3$($1
)#
The following data step e'ec&tes(
data salar%;
set m%li.emplo%ees;
0aise ) '100I';
i< Jo2ode ) '/ilot';
0aise ) '&0I';
run;
What will the 2al&e of aise in the o&tp&t SAS data set $e/ if Jo%code = ''lt"tt'?
A. -;J
B. 7;;J
. This "(ser'ati"n 3i&& n"t appear in the "utput$
%. &'#e '( the ab've.
34
PROG1 Chapter 8:
Objective: (1.5.1) &A1A Step .oncatenation
Item: 1$6$1$a$1
)6
D&ring Data Step oncatenation/ when will initialiMation of e'isting SAS 2aria$les ta4e place?
I. When SAS reads a new o$ser2ation.
II. When SAS starts processing the other Data set.
III. When control ret&rns to the top of the DATA step.
A. II$ "n&2
B. I. and II. onl*
. II. and III. onl*
D. I./ II. and III.
Item: 1$6$1$($1
))
Which of the following programs will com$ine Sisters.(ne and Sisters.#)o to prod&ce Sisters.#hree as shown
$elow?
A$ data sisters.three;
set sisters.one sisters.two;
run;
B. data sisters.t,ree;
set sisters.one;
set sisters.two;
run;
. data sisters.t,ree;
set sisters.one sisters.two;
% -ar2;
run;
D. data sisters.t,ree;
mer+e sisters.one sisters.two;
% -ar2;
run;
Item: 1$6$1$!$1
1**
Which of the following programs will com$ine Sisters.(ne and Sisters.#)o to prod&ce Sisters.#hree as shown
$elow?
35
A. data sisters.t,ree;
set sisters.one sisters.two;
run;
B. data sisters.three;
set sisters.one sisters.two;
by var);
run;
. data sisters.t,ree;
mer+e sisters.one sisters.two;
% -ar8;
run;
D. data sisters.t,ree;
set sisters.one;
set sisters.two;
% -ar8;
run;
Objective: (1.5.2) &A1A Set Options
Item: 1$6$2$a$1
1*1
Which of the following statements correctl* renames the 2aria$le 'irstName to 'name?
A. set wor8.newrena-e = 6irst(a-e = 6na-e,,;
B. set work.new9rename FirstName ) Fname;;
. set work.new rename ) 9FirstName ) Fname;;
D. set work.new9rename ) 9FName ) FirstName;;;
Objective: (1.5.!) 6erging SAS $ata sets
Item: 1$6$3$a$1
1*2
Which of the following programs will com$ine Sisters.(ne and Sisters.#)o to prod&ce Sisters.#hree as shown
$elow?
36
A. data sisters.t,ree;
set sisters.one sisters.two;
run;
B. data sisters.t,ree;
set sisters.one sisters.two;
% -ar8;
run;
. data sisters.three;
-erge sisters.one sisters.two;
by var);
run;
D. data sisters.t,ree;
set sisters.one;
set sisters.two;
% -ar8;
run;
Item: 1$6$3$($1
1*3
Which of the following programs will com$ine Sisters.(ne and Sisters.#)o to prod&ce Sisters.#hree as shown
$elow?
A. data sisters.t,ree;
set sisters.one sisters.two;
run;
B. data sisters.three;
-erge sisters.one sisters.two;
run;
. data sisters.t,ree;
set sisters.one sisters.two;
% -ar8;
run;
D. data sisters.t,ree;
mer+e sisters.one sisters.two;
% -ar8;
run;
1 2 % 3 4 5 % 6 C 7 C 8 9 ) 10 % 11 % 12 C 13 C 14 15 C
16 ) 17 ) 18 C 19 % 20 % 21 22 ) 23 % 24 25 % 26 27 28 % 29 30 %
31 % 32 ) 33 C 34 35 ) 36 37 C 38 % 39 ) 40 ) 41 C 42 43 44 45 % 46 % 47 %
48 ) 49 ) 50 % 51 % 52 ) 53 C 54 % 55 ) 56 57 58 C 59 C 60 ) 61 62 )
37
63 % 64 ) 65 66 % 67 C 68 ) 69 70 ) 71 ) 72 % 73 74 % 75 ) 76 C 77 78 ) 79 %
80 C 81 % 82 83 84 C 85 86 C 87 C
88 % 89 ) 90 C 91 % 92 C 93 ) 94 % 95 ) 96 97 C 98 99 100 ) 101 102 C 103 )
38

S-ar putea să vă placă și