Upload
rajashekar-gatla
View
220
Download
0
Embed Size (px)
Citation preview
8/13/2019 PROG2 Assessment
1/66
PROG2 ASSESSMENT
PROG2 Chapter 2: ................................................................................................................................2Objective: (2.2.1) Explicitly control output of observations to SAS dataset.......................................................2Objective: (2.2.2) Writin to !ultiple SAS datasets..........................................................................................."
Objective: (2.2.#) Subsettin $%&state'ent..........................................................................................................
Objective: (2.2.) *ontrollin +ariable output....................................................................................................,
Objective: (2.2.") *ontrollin -ic Observations are /ead............................................................................11Objective: (2.2.) 0e'porary +ariables............................................................................................................1#
Objective: (2.2.,) Writin to an External %ile...................................................................................................1PROG2 Chapter 3: ..............................................................................................................................15
Objective: (2.#.1) *reatin an Accu'ulatin +ariable.....................................................................................1"
Objective: (2.#.2) Accu'ulatin 0otals for roup of ata...............................................................................2#
Objective: (2.#.#) Subsettin $%&state'ents.......................................................................................................2PROG2 Chapter 4................................................................................................................................27
Objective: (2..1) /eadin ra- data files..........................................................................................................2,
Objective: (2..2) /eadin ierarcical files.....................................................................................................#3PROG2 Chapter 5................................................................................................................................39
Objective: (2.".1) 4sin SAS %unctions............................................................................................................#5Objective: (2.".2) !EA6 %unction...................................................................................................................7
Objective: (2.".#) S*A6 %unction....................................................................................................................2Objective: (2.".) $6068 %unction...................................................................................................................
Objective: (2.".") S49S0/ and *oncatenation................................................................................................"
Objective: (2.".) S49S0/...............................................................................................................................Objective: (2.".,) *oncatenation ......................................................................................................................5
Objective: (2.".3) S*A6 %unction and *oncatenation....................................................................................."7
Objective: (2.".5) $6E8 %unction..................................................................................................................."1Objective: (2.".17) 0/A6W/ %unction........................................................................................................."2
Objective: (2.".11) /O46 %unction..............................................................................................................."
Objective: (2.".12) *E$ %unction...................................................................................................................."Objective: (2.".1#) %OO/ %unction................................................................................................................",
Objective: (2.".1) $60 %unction......................................................................................................................"3
Objective: (2.".1") S4! %unction....................................................................................................................7
Objective: (2.".1) ate %unctions....................................................................................................................2PROG2 Chapter 7................................................................................................................................65
Objective: (2.,.1) O oop ;rocessin............................................................................................................."
Objective: (2.,.2) S4! State'ent.....................................................................................................................
8/13/2019 PROG2 Assessment
2/66
PROG1 assessment questions
PROG2 assessment !est"#ns
PROG2 Chapter 2:
Objective: (2.2.1) Explicitly control output of observations to SAS dataset
$tem: 2.2.1.a.1
The following data step executes:
data a b; set c; if Dept = 'Admin' then output a; run;
Given the dataset work.cbelow, how many obsevations will the datasets aand bcontain!
"# a $ %b $ &
'# a $ %b $ (
)# a $ %b $ *
+# a $ &b $ &
Page of --
8/13/2019 PROG2 Assessment
3/66
PROG1 assessment questions
$tem: 2.2.1.%.1
The following data step executes:
data a b; set c; if Dept = 'Admin' then output; run;
Given the dataset work.cbelow, how many obsevations will the datasets aand bcontain!
"# a $ %b $ &
'# a $ %b $ %
)# a $ %b $ *
+# a $ &b $ &
Page % of --
8/13/2019 PROG2 Assessment
4/66
PROG1 assessment questions
$tem: 2.2.1.&.1
The following data step executes:
data a; set b; Total + 1; output; Total + 1; output; Total + 1; output; run;
.ow many obsevations will be witten to dataset awith ea&h "terat"#n!
"# 1
'# %
)# /
+# 0one of the above#
Page / of --
8/13/2019 PROG2 Assessment
5/66
PROG1 assessment questions
Objective: (2.2.2) Writin to !ultiple SAS datasets
$tem: 2.2.2.a.1
The following data step executes:
data a b; set c; if Dept = 'Admin' then output a else output b; run;
Given the dataset work.cbelow, how many obsevations will dataset aand bcontain!
"# a $ %
b $ *
'# a $ %b $ (
)# a $ %b $ &
+# a $ &b $ &
Page * of --
8/13/2019 PROG2 Assessment
6/66
PROG1 assessment questions
Objective: (2.2.") Subsettin #$%state&ent
$tem: 2.2.3.a.1
The following data step executes:
data a b; set c; if Dept = 'Admin'; run;
Given the dataset work.cbelow, how many obsevations will datasets aand bcontain!
"# a $ %b $ %
'# a $ &b $ &
)# a $ %b $ *
+# a $ %b $ &
Page - of --
8/13/2019 PROG2 Assessment
7/66
PROG1 assessment questions
Objective: (2.2.') ontrollin ariable output
$tem: 2.2.4.a.1
The following data step executes:
data b; set a; drop Salary; Bonus = Salary * .1; run;
Given the dataset work.abelow, which of the following vaiables will appea in dataset b!
"# mp0o, +ept and 'onus
'# mp0o, +ept and 2alay
)# mp0o, 2alay and 'onus
+# mp0o, +ept, 2alay and 'onus
Page 3 of --
8/13/2019 PROG2 Assessment
8/66
PROG1 assessment questions
$tem: 2.2.4.%.1
The following data step executes:
data b; set a; drop Salary; Bonus = Salary * .1; run;
Given the dataset work.a below, which of the following vaiables will appea in the P+4 5Pogam +ata4ecto6!
"# mp0o, +ept and 'onus
'# mp0o, +ept and 2alay
)# mp0o, 2alay and 'onus
+# mp0o, +ept, 2alay and 'onus
Page & of --
8/13/2019 PROG2 Assessment
9/66
PROG1 assessment questions
$tem: 2.2.4.&.1
The following data step executes:
data b!"eep = Salary Bonus#; set a!drop = $mp%o#; Bonus = Salary * .1; run;
Given the dataset work.a below, which of the following vaiables will appea in the P+4 5Pogam +ata4ecto6!
"# +ept and 2alay
'# 2alay and 'onus
)# +ept, 2alay and 'onus
+# mp0o, 2alay and 'onus
Page 7 of --
8/13/2019 PROG2 Assessment
10/66
PROG1 assessment questions
$tem: 2.2.4.'.1
The following data step executes:
data b; set a!"eep = $mp%o Salary#; Bonus = Salary * .1; run;
Given the dataset work.a below, which of the following vaiables will appea in the P+4 5Pogam +ata4ecto6!
"# mp0o and 2alay
'# mp0o, +ept and 2alay
)# mp0o, 2alay and 'onus
+# mp0o, +ept, 2alay and 'onus
Page 1( of --
8/13/2019 PROG2 Assessment
11/66
PROG1 assessment questions
Objective: (2.2.*) ontrollin +,ic, Observations are -ead
$tem: 2.2.5.a.1
The following data step executes:
data a; set b !obs = run;
8hich of the following obsevations will be ead!
"# 1 to *
'# * till end
)# obsevation * only
+# * andomly selected obsevations
$tem: 2.2.5.%.1
The following data step executes:
data a; set b !firstobs = & obs = run;
8hich of the following obsevations will be ead!
"# ( to *
'# ( and *
)# ( and * till end
+# * obsevations, stating at obsevation (
Page 11 of --
8/13/2019 PROG2 Assessment
12/66
PROG1 assessment questions
$tem: 2.2.5.&.1
The following data step executes:
data a; set b !firstobs = run;
8hich of the following obsevations will be ead!
"# obsevation * only
'# obsevations 1 to *
)# * till end of dataset
+# obsevation * fist, then andomly selected obsevations
Page 1 of --
8/13/2019 PROG2 Assessment
13/66
PROG1 assessment questions
Objective: (2.2.) /e&porary ariables
$tem: 2.2.6.a.1
8hich of the following is epesented by the automatic vaiable_N_ !
"# The numbe of active datasets#
'# The numbe of obsevations in a dataset#
)# The numbe of iteations of the +"T" step duing dataset pocessing#
+# The obsevation numbe being pocessed duing the +"T" step pocessing#
$tem: 2.2.6.%.1
8hich of the following coectly descibes the effect of using the END= option in the SET statement!
"# The last obsevation is ead fom a dataset#
'# The data step label is executed at the end of the data step#
)# " vaiable is set to 1 until the last obsevation is ead fom a dataset#
+# " vaiable is set to 1 when the last obsevation is ead fom a dataset#
Page 1% of --
8/13/2019 PROG2 Assessment
14/66
PROG1 assessment questions
Objective: (2.2.0) Writin to an External $ile
$tem: 2.2.7.a.1
8hich of the following pogams coectly wites the obsevations fom the dataset below to a aw data file!
"# data (%)(; set or".patients; file 'c,-clinic-patients-referals.dat'; put id 1/ se0 a2e 34 hei2ht 111&
ei2ht 1/1 pulse 13&;run;
'# data (%)(; set or".patients; infile 'c,-clinic-patients-referals.dat'; input id 1/ se0 a2e 34 hei2ht 111&
ei2ht 1/1 pulse 13&;run;
)# data referals.dat; set or".patients; input id 1/ se0 a2e 34 hei2ht 111& ei2ht 1/1 pulse 13&;run;
+# data (%)(; set or".patients; file c,-clinic-patients-referals.dat; put id 1/ se0 a2e 34 hei2ht 111& ei2ht 1/1 pulse 13&;run;
Page 1/ of --
8/13/2019 PROG2 Assessment
15/66
PROG1 assessment questions
PROG2 Chapter 3:
Objective: (2.".1) reatin an Accu&ulatin ariable
$tem: 2.3.1.a.1
The following data step executes:
data ne; set old; retain Total ; Total = Total + Sales; run;
Given the input file below, what will be the esult!
"#
'#
)#
Page 1* of --
8/13/2019 PROG2 Assessment
16/66
PROG1 assessment questions
+#
$tem: 2.3.1.%.1
The following data step executes:
data ne; set old; Total = Total + Sales; run;
Given the input file below, what will be the esult!
"#
'#
Page 1- of --
8/13/2019 PROG2 Assessment
17/66
PROG1 assessment questions
)#
+#
$tem: 2.3.1.&.1
The following data step executes:
data ne; set old; Total + Sales; run;
Given the input file below, what will be the esult!
"#
Page 13 of --
8/13/2019 PROG2 Assessment
18/66
PROG1 assessment questions
'#
)#
+#
$tem: 2.3.1.'.1
The following data step executes:
data ne;
set old; retain Total 1; Total + Sales; run;
Given the input file below, what will be the esult!
Page 1& of --
8/13/2019 PROG2 Assessment
19/66
PROG1 assessment questions
"#
'#
)#
+#
$tem: 2.3.1.e.1
The following data step executes:
data ne; set old; retain Total ; Total = sum!Total5Sales#; run;
Given the input file below, what will be the esult!
Page 17 of --
8/13/2019 PROG2 Assessment
20/66
PROG1 assessment questions
"#
'#
)#
+#
Page ( of --
8/13/2019 PROG2 Assessment
21/66
PROG1 assessment questions
$tem: 2.3.1.(.1
The following data step executes:
data ne; set old; retain Total 1; Total = sum!Total5Sales#; run;
Given the input file below, what will be the esult!
"#
'#
)#
+#
Page 1 of --
8/13/2019 PROG2 Assessment
22/66
PROG1 assessment questions
Page of --
8/13/2019 PROG2 Assessment
23/66
PROG1 assessment questions
Objective: (2.".2) Accu&ulatin /otals for roup of ata
$tem: 2.3.2.a.1
8hich of the following is indicated when LAST.variable is true!
"# The last element of an aay#
'# The last iteation of a DOloop#
)# The cuent obsevation is the last one in the dataset#
+# The cuent obsevation is the last one of BY goupx#
$tem: 2.3.2.%.1
The following data step executes:
data summary; set employees; drop $mp%o; by Dept; if first.dept = 1 then total = ; Total + Salary; if last.dept; run;
Given the input file below, what will be the esult!
"#
Page % of --
8/13/2019 PROG2 Assessment
24/66
8/13/2019 PROG2 Assessment
25/66
PROG1 assessment questions
$tem: 2.3.2.'.1
8hich of the following statements is )A*SE!
8hen using the '< statement with the 2T statement###
"# 9R2T# and ;"2T# ae stoed in the dataset#
'# 9R2T# and ;"2T# identify the fist and last obsevation in each '< goup espectively#
)# the dataset listed in the 2T statement must be indexed o soted by the values of the '< vaiable#
+# the +"T" step automatically ceates two vaiables = 9R2T# and ;"2T# = fo each vaiable in the 'T statement vaiables#
8hich of the following 09; statements option should be used!
"# +2+
'# ;R);$
)# ;02A$
+# B22O4R
$tem: 2.4.1.'.1
The following pogam executes:
data sales; infile radata; input date date8. Dailysum 77; run;
Given the aw data file below, how many obsevations will be ceated!
"# *
'# 1(
)# 1*
+# (
Page & of --
8/13/2019 PROG2 Assessment
29/66
PROG1 assessment questions
$tem: 2.4.1.e.1
The following pogam executes:
data one; infile radata; input 7: year /.; if year = 1448 then input 73 amount :.; run;
Given the aw data file below, how many obsevations will be ceated!
"#
'# /
)# *
+# -
$tem: 2.4.1.(.1
8hich of the following types of input will be used to ead chaacte and numeic data that ae 0OT stoed infixed locations!
"# ;2T input
'# )O;>B0 input
)# 9ORB"TT+ input
+# 0one of the above#
Page 7 of --
8/13/2019 PROG2 Assessment
30/66
PROG1 assessment questions
$tem: 2.4.1.+.1
8hich of the following types of input can be used to ead standad chaacte and numeic data that ae stoedin fixed locations!
"# )O;>B0 input only
'# 9ORB"TT+ input only
)# )O;>B0 and ;2T input
+# )O;>B0 and 9ORB"TT+ input
$tem: 2.4.1.h.1
8hich of the following types of input can be used to ead non=standad chaacte and numeic data that ae
stoed in fixed locations!
"# ;2T input
'# 0"B+ input
)# )O;>B0 input
+# 9ORB"TT+ input
$tem: 2.4.1.".1
8hich of the following 2"2 statements associates the fileef crime with the aw data file !"#$Docume%ts"rime!
"# filename crime ,-
8/13/2019 PROG2 Assessment
31/66
PROG1 assessment questions
$tem: 2.4.1.,.1
8hich of the following statements coectly eads the fields in this ode: StockNo, &rice, 'tem, (i%is), St$le!
"# input Stoc"%o 6 1: rice &8:& >tem 6 &&/ ?inish 6 4 Style 6 1113;
'# input 6 Stoc"%o 1: rice &8:& 6 >tem &&/ 6 ?inish 4 6 Style 1113;
)# input Stoc"%o 6 1: ?inish 6 4 Style 6 1113 >tem 6 &&/ rice &8:&;
+# input Stoc"%o 6 1: rice 6 &8:& >tem 6 &&/ ?inish 6 4 Style 6 1113;
$tem: 2.4.1.-.1
8hich of the following will be egaded as non=standad data!
"# 13#-
'# =*#%
)# ,%31#-1
+# 1#*/C(%
Page %1 of --
8/13/2019 PROG2 Assessment
32/66
PROG1 assessment questions
$tem: 2.4.1..1
8hat is an infomat!
"n instuction that specifies to 2"2###
"# to ceate a vaiable#
'# how to ead aw data#
)# how to display data values#
+# how to display vaiable labels#
$tem: 2.4.1.m.1
8hat is the default length of chaacte vaiables that ae ceated when using ;2T input!
"# &
'# **
)# ((
+# The length of the vaiable being ead#
Page % of --
8/13/2019 PROG2 Assessment
33/66
PROG1 assessment questions
$tem: 2.4.1.#.1
The following pogam executes:
data one; infile ',-numbers.dat'; input @ 77; if @=1 then @=; if @=& then @=/; if @=/ then @=:; if @= then @=1; run;
Given the aw data file below, what will the contents of the 2"2 dataset o%ebe!
"#
'#
)#
Page %% of --
8/13/2019 PROG2 Assessment
34/66
PROG1 assessment questions
+#
$tem: 2.4.1.p.1
The following pogam executes:
data staff; infile radata;
input name 64. 71 dept 6. 71 salary . 7&1 office 6:. 7&/ country 6&.; run;
Given the table below, what value will be assigned to the vaiable salar$!
"# 13
'# 13*(
)# 13#*(
+# # 5missing6
Page %/ of --
8/13/2019 PROG2 Assessment
35/66
PROG1 assessment questions
$tem: 2.4.1..1
n which of the following statements can the DL#= option be used!
"# 2T statement
'# +"T" statement
)# 0P>T statement
+# 09; statement
$tem: 2.4.1.r.1
8hat will the default delimete be set to when the +2+ option is used!
"# blan@
'# : 5colon6
)# , 5comma6
+# tab chaacte
$tem: 2.4.1.s.1
8hich of the following 2"2 statements coectly eads the values fo (%ame, L%ame,A**ress, it$, State and+ip in that ode!
"# >nput ?name 6 name 6; Address 6&.; ity 6 State 6 ip 6;
'# >nput ?name 6 name 6 Address 6&.
Page %* of --
8/13/2019 PROG2 Assessment
36/66
PROG1 assessment questions
ity 6 State 6 ip 6;
)# >nput ?name 6 name 6 Address 6&. ity 6 State 6 ip 6;
+# >nput ?name 6 name 6 ;
Address 6&. ; ity 6 State 6 ip 6;
$tem: 2.4.1.t.1
8hich of the following statements about the *ouble traili%, -at si,%5??6 is NOT TR/E!
"# t must be the last item specified in the 0P>T statement#
'# t is eleased when the input pointe moves past the end of the ecod#
)# t enables the next 0P>T statement to ead fom the cuent ecod in the same iteation of the+"T" step#
+# t enables the next 0P>T statement to ead fom the cuent ecod acoss multiple iteations of the+"T" step#
$tem: 2.4.1.!.1
8hich of the following statements is tue!
" ecod that is being held by a si%,le traili%, -at si,%5?6 will be automatically eleased when###
"# the next iteation of the +"T" step begins#
'# anothe value is ead fom the obsevation#
)# the input pointe moves past the end of the ecod#
+# anothe 0P>T statement that has an ? executes#
Page %- of --
8/13/2019 PROG2 Assessment
37/66
PROG1 assessment questions
$tem: 2.4.1.0.1
8hich of the following is an example of standad numeic data!
"# 1D
'# *(E
)# =%/#*-
+# F/,%/#*
$tem: 2.4.1..1
8hich infomat should be used to ead the values in column 1 = *!
"# w#
'# Fw#
)# w#d
+# commaw#d
$tem: 2.4.1..1
8hich of the following statements coectly identifies the name of a aw data file which is to be ead with afileefpro*uctsand specifies that the data step only eads ecods 1 = 1*!
"# input products 1 1;
'# infile products obs 1;
)#input products obs = 1;
+# infile products obs = 1;
Page %3 of --
8/13/2019 PROG2 Assessment
38/66
PROG1 assessment questions
Objective: (2.'.2) -eadin ,ierarc,ical files
$tem: 2.4.2.a.1
8hich of the following statements ae tue when eading hieachical files!
To wite a data step to ceate one obsevation pe detail ecod it is necessay to
>. distinguish between heade and detail ecods# >>. hold the cuent value of each ecod type so that the othe values in the ecod can be ead# >>>. etain the heade ecod as pat of each obsevation until the next heade ecod is encounteed#
"# >. and >>. only
'# >. and >>>. only
)# >>. and >>>. only
+# >.5 >>. and >>>.
Page %& of --
8/13/2019 PROG2 Assessment
39/66
PROG1 assessment questions
PROG2 Chapter 5
Objective: (2.*.1) 3sin SAS $unctions
$tem: 2.5.1.a.1
8hich of the following chaactes is used to sepaate aguments within a 2"2 function!
"# blan@
'# : 5colon6
)# , 5comma6
+# 5semi colon6
Page %7 of --
8/13/2019 PROG2 Assessment
40/66
PROG1 assessment questions
Objective: (2.*.2) !EA4 $unction
$tem: 2.5.2.a.1
The following pogam executes:
data aCera2es; set uarters; aCera2e = mean!tr15tr&5tr:5tr/#; run;
Given the obsevation shown in the table below, what will the value of avera,e be!
"# (
'# %
)# /
+# # 5missing6
$tem: 2.5.2.%.1
.ow can the list of aguments in the B"0 function of the pogam below be abbeviated!
data aCera2es; set uarters; aCera2e = mean!tr15tr&5tr:5tr/#; run;
"# mean !tr1 /#
'# mean !tr1 tr/#
)# mean !of tr1 /#
+# mean !of tr1 tr/#
Page /( of --
8/13/2019 PROG2 Assessment
41/66
PROG1 assessment questions
$tem: 2.5.2.&.1
The following pogam executes:
data aCera2es; set uarters; aCera2e = mean!of tr1tr/#; run;
Given the obsevation shown in the table below, what will the value of avera,e be!
"# (
'# %
)# /
+# # 5missing6
$tem: 2.5.2.'.1
8hich of the following functions calculates the aveage of the vaiables /tr0, /tr1, /tr2 and /tr3!
"# AEF !of Gtr15Gtr/#
'#
8/13/2019 PROG2 Assessment
42/66
8/13/2019 PROG2 Assessment
43/66
PROG1 assessment questions
$tem: 2.5.3.&.1
The following data step executes:
data strin2s; Te0t1 = HI$J 2
'# +O0";+
)# +O0";+ +>)J
+# I+O0";+ +>)J
Page /% of --
8/13/2019 PROG2 Assessment
44/66
PROG1 assessment questions
Objective: (2.*.') #4/45 $unction
$tem: 2.5.4.a.1
The esult of
!...# >%T%@!'J$AM'5'&4?$B143'D51# !...#
is a new date#
8hat will the new date be if the +"T7# fomat is used!
"# (1K"017&1
'# &9'17&1
)# 79'17&1
+# (1B"R17&1
Page // of --
8/13/2019 PROG2 Assessment
45/66
PROG1 assessment questions
Objective: (2.*.*) S36S/- and oncatenation
$tem: 2.5.5.a.1
The following pogam executes:
data strin2s; len2th te0t 6 : te0t& 6 :; Te0t = H?M>$%DS5 $%D
8/13/2019 PROG2 Assessment
46/66
PROG1 assessment questions
Objective: (2.*.) S36S/-
$tem: 2.5.6.a.1
" new vaiable which was not peviously defined with a ;0GT. statement is ceated with the 2>'2TR
function#
8hat will the length of the new vaiable be!
"# &
'# 1
)# ((
+# The length of the vaiable used in the function#
$tem: 2.5.6.%.1
The following data step executes:
data strin2s; Te0t1 = HI$J
8/13/2019 PROG2 Assessment
47/66
PROG1 assessment questions
$tem: 2.5.6.&.1
The following data step executes:
data strin2s; Te0t1 = HI$J
8/13/2019 PROG2 Assessment
48/66
PROG1 assessment questions
$tem: 2.5.6.e.1
The following data step executes:
data strin2s; Te0t1 = HI$J
8/13/2019 PROG2 Assessment
49/66
PROG1 assessment questions
Objective: (2.*.0) oncatenation
$tem: 2.5.7.a.1
The following data step executes:
data strin2s; Te0t = H
8/13/2019 PROG2 Assessment
50/66
PROG1 assessment questions
Objective: (2.*.7) SA4 $unction and oncatenation
$tem: 2.5..a.1
The following data step executes:
data strin2s; Te0t1 = HI$J H OO scan!Te0t15 run;
8hat will the length of the vaiable Textbe!
"# 7
'# 1*
)# ((
+# (/
$tem: 2.5..%.1
The following data step executes:
data strin2s; len2th Te0t& 6 1; Te0t1 = HI$J H OO H H OO Te0t&; run;
8hat will the length of the vaiable Textbe!
"# 1(
'# 1*
)# 1-
+# (*
Page *( of --
8/13/2019 PROG2 Assessment
51/66
PROG1 assessment questions
Objective: (2.*.8) #4E5 $unction
$tem: 2.5.9.a.1
The following data step executes:
data strin2s; Te0t1 = HI$J
8/13/2019 PROG2 Assessment
52/66
PROG1 assessment questions
Objective: (2.*.19) /-A4W- $unction
$tem: 2.5.1.a.1
The following data step executes:
data strin2s; Te0t1 = HI$J
8/13/2019 PROG2 Assessment
53/66
PROG1 assessment questions
$tem: 2.5.1.&.1
The following data step executes:
data strin2s; Te0t1 = HI$J
8/13/2019 PROG2 Assessment
54/66
8/13/2019 PROG2 Assessment
55/66
PROG1 assessment questions
$tem: 2.5.11.&.1
The following statement executes:
Ear1 = round!&:./835.1#;
8hat will the value of the vaiable 4ar0 be!
"# %#/&
'# %#/&(
)# %#*
+# /
$tem: 2.5.11.'.1
The following statement executes:
Ear1 = round!&:./851#;
8hat will the value of the vaiable 4ar0 be!
"# (
'# %
)# %#*
+# /
Page ** of --
8/13/2019 PROG2 Assessment
56/66
8/13/2019 PROG2 Assessment
57/66
8/13/2019 PROG2 Assessment
58/66
PROG1 assessment questions
Ob5ective! 61.7.038 'NT (u%ctio%
$tem: 2.5.14.a.1
The following statement executes:
Ear1 = int!&:.1&3#;
8hat will the value of the vaiable 4ar0 be!
"# %
'# %#1
)# %#1&
+# %#1%
$tem: 2.5.14.%.1
The following statement executes:
Ear1 = int!&:.3/#;
8hat will the value of the vaiable 4ar0 be!
"# %
'# %#&/
)# %#7
+# /
Page *& of --
8/13/2019 PROG2 Assessment
59/66
PROG1 assessment questions
$tem: 2.5.14.&.1
The following statement executes:
Ear1 = int!&:.3/#;
8hat will the value of the vaiable 4ar0 be!
"# =%
'# =%#&/
)# =%#7
+# =/
Page *7 of --
8/13/2019 PROG2 Assessment
60/66
PROG1 assessment questions
Objective: (2.*.1*) S3! $unction
$tem: 2.5.15.a.1
The following pogam executes:
data aCera2es; set uarters; total = sum!tr15tr&5tr:5tr/#; run;
Given the obsevation shown in the table below, what will the value of totalbe!
"# %
'# 7
)# 1
+# # 5missing6
$tem: 2.5.15.%.1
.ow can the list of aguments in the 2>B function below be abbeviated!
data aCera2es; set uarters; total = sum!tr15tr&5tr:5tr/#; run;
"# sum !tr1 /#
'# sum !of tr1 /#
)# sum !tr1 tr/#
+# sum !of tr1 tr/#
Page -( of --
8/13/2019 PROG2 Assessment
61/66
PROG1 assessment questions
$tem: 2.5.15.&.1
8hich of the following functions calculates the total of vaiables /tr0, /tr1, /tr2 and /tr3!
"# sum !of Gtr15Gtr/#
'# tot !of Gtr15Gtr/#
)# sum !of Gtr1 Gtr/#
+# tot !of Gtr1 Gtr/#
Page -1 of --
8/13/2019 PROG2 Assessment
62/66
PROG1 assessment questions
Objective: (2.*.1) ate $unctions
$tem: 2.5.16.a.1
8hich of the following statements will coectly ceate a 2"2 date value fo the 1 Oct ((!
"# dt1 = mdy!15&15&
'# dt1 = dmy!&1515&
)# dt1 = date!15&15&
+# dt1 = mmmddyy!15&15&
$tem: 2.5.16.%.1
8hich of the following statements will coectly ceate a 2"2 date value fo the 1 Oct ((!
"# dt1 = mdy!15&15&
'# dt1 = dmy!&1 1 &
)# dt1 = date!1,&1,&
+# dt1 = mmmddyy!1 &1
$tem: 2.5.16.&.1
The following statement executes:
DayCal = DAJ!TKDAJ! ##;
8hat will the value of Da$val be fo Bonday, 1 Oct (( as todayMs date!
"#
'# 1
)# # 5missing6
+# 1*-%/ 50umbe of days since 1 Kan 17-(6
Page - of --
8/13/2019 PROG2 Assessment
63/66
PROG1 assessment questions
$tem: 2.5.16.'.1
The following statement executes:
DayCal = P$$IDAJ!TKDAJ! ##;
8hat will the value of Da$val be fo Bonday, 1 Oct (( as todayMs date!
"# 1
'#
)# 1
+# 1*-%/ 50umbe of days since 1 Kan 17-(6
$tem: 2.5.16.e.1
The following statement executes:
JrCal = J$AM!TKDAJ! ##;
8hat will the value of Yrval be fo Bonday, 1 Oct (( as todayMs date!
"#
'# (
)# ((
+# # 5missing6
Page -% of --
8/13/2019 PROG2 Assessment
64/66
PROG1 assessment questions
$tem: 2.5.16.(.1
The following statement executes:
8/13/2019 PROG2 Assessment
65/66
8/13/2019 PROG2 Assessment
66/66
PROG1 assessment questions
Objective: (2.0.2) S3! State&ent
$tem: 2.7.2.a.1
8hich of the following statements is a coect example of a 2>B statement!
"# Total+1;
'# 'Total' + 1;
)# Total = Total +1;
+# Total = S)