Anda di halaman 1dari 145

1. 2.

.0 The following SAS program is submitted: data test; set sasuser.employees; if 2 le years_servi e le 10 then amount ! 1000; else if years_servi e gt 10 then amount ! 2000; else amount ! 0; amount_per_year ! years_servi e " amount; run; #hi h one of the following values does the variable A$%&'T_()*_+)A* ontain if an employee has been with the ompany for one year, A. 0 -. 1000 .. 2000 /. . 0missing numeri value1 Ans: /

2.

The ontents of the raw data file A$%&'T are listed below: 3333333310333333320333333320 415226 The following SAS program is submitted: data test; infile 7amount7; input 81 salary 9.; if _error_ then des ription ! 7(roblems7; else des ription ! 7'o (roblems7; run; #hi h one of the following is the value of the /)S.*:(T:%' variable, A. (roblems -. 'o (roblems .. 7 7 0missing hara ter value1 /. The value an not be determined as the program fails to e;e ute due to errors. Ans: A

6.

The ontents of the raw data file 'A$)'&$ are listed below: 3333333310333333320333333320 <oe ;; The following SAS program is submitted: data test; infile 7namenum7; input name 4 number; run; #hi h one of the following is the value of the '&$-)* variable, A. ;; -. <oe .. . 0missing numeri value1 /. The value an not be determined as the program fails to e;e ute due to errors.

Ans: =. The ontents of the raw data file A$%&'T are listed below: 3333333310333333320333333320 415226 The following SAS program is submitted: data test; infile 7amount7; input 81 salary 9.; run; #hi h one of the following is the value of the SA>A*+ variable, A. 1226 -. 15226 .. 415226 /. . 0missing numeri value1 Ans: d 9. #hi h one of the following statements is true regarding the SAS automati _)**%*_ variable, A. The _)**%*_ variable ontains the values 7%'7 or 7%??7. -. The _)**%*_ variable ontains the values 7T*&)7 or 7?A>S)7. .. The _)**%*_ variable is automati ally stored in the resulting SAS data set. /. The _)**%*_ variable an be used in e;pressions or al ulations in the /ATA step. Ans: d @. #hi h one of the following is true when SAS en ounters a data error in a /ATA step, A. The /ATA step stops e;e uting at the point of the error5 and no SAS data set is reated. -. A note is written to the SAS log e;plaining the error5 and the /ATA step ontinues to e;e ute. .. A note appears in the SAS log that the in orre t data re ord was saved to a separate SAS file for further e;amination. /. The /ATA step stops e;e uting at the point of the error5 and the resulting /ATA set ontains observations up to that point. Ans: b A. The following SAS program is submitted: data worB.totalsales 0Beep ! monthsalesC12D 1; set worB.monthlysales 0Beep ! year produ t sales1; array monthsales C12D ; do i!1 to 12; monthsalesCiD ! sales; end; run; The data set named #%*E.$%'TF>+SA>)S has one observation per month for ea h of five years for a total of 90 observations. #hi h one of the following is the result of the above program, A. The program fails e;e ution due to data errors. -. The program fails e;e ution due to synta; errors. .. The program e;e utes with warnings and reates the #%*E.T%TA>SA>)S data set. /. The program e;e utes without errors or warnings and reates the #%*E.T%TA>SA>)S data set. Ans: b G. The following SAS program is submitted: data worB.totalsales;

set worB.monthlysales0Beep ! year produ t sales1; retain monthsales C12D ; array monthsales C12D ; do i ! 1 to 12; monthsalesCiD ! sales; end; nt H 1; monthsalesC ntD ! sales; run; The data set named #%*E.$%'TF>+SA>)S has one observation per month for ea h of five years for a total of 90 observations. #hi h one of the following is the result of the above program, A. The program fails e;e ution due to data errors. -. The program fails e;e ution due to synta; errors. .. The program runs with warnings and reates the #%*E.T%TA>SA>)S data set with 90 observations. /. The program runs without errors or warnings and reates the #%*E.T%TA>SA>)S data set with 90 observations. Ans: b 10. The following SAS program is submitted: data worB.Ianuary; set worB.allmonths 0Beep ! produ t month num_sold ost1; if month ! 7<an7 then output worB.Ianuary; sales ! ost J num_sold; Beep ! produ t sales; run; #hi h variables does the #%*E.<A'&A*+ data set ontain, A. (*%/&.T and SA>)S only -. (*%/&.T5 $%'TF5 '&$_S%>/ and .%ST only .. (*%/&.T5 SA>)S5 $%'TF5 '&$_S%>/ and .%ST only /. An in omplete output data set is reated due to synta; errors. Ans: d 11. The ontents of the raw data file .A>)'/A* are listed below: 3333333310333333320333333320 01012000 The following SAS program is submitted: data test; infile 7 alendar7; input 81 date mmddyy10.; if date ! 7010120007d then event ! 7<anuary 1st7; run; #hi h one of the following is the value of the )K)'T variable, A. 01012000 -. <anuary 1st .. . 0missing numeri value1 /. The value an not be determined as the program fails to e;e ute due to errors. Ans: d 12. A SAS program is submitted and the following SAS log is produ ed: 2 data gt100; 2 set ia.airplanes

6 if mpg gt 100 then output; 22 202 )**%*: ?ile #%*E.:?./ATA does not e;ist. )**%*: ?ile #%*E.$(L./ATA does not e;ist. )**%*: ?ile #%*E.LT./ATA does not e;ist. )**%*: ?ile #%*E.TF)'./ATA does not e;ist. )**%*: ?ile #%*E.%&T(&T./ATA does not e;ist. )**%* 223222: Synta; error5 e;pe ting one of the following: a name5 a Muoted string5 05 ;5 )'/5 E)+5 E)+S5 '%-S5 %()'5 (%:'T5 _/ATA_5 _>AST_5 _'&>>_. )**%* 2023222: The option or parameter is not re ogniNed and will be ignored. = run; The :A libref was previously assigned in this SAS session. #hi h one of the following orre ts the errors in the >%L, A. /elete the word TF)' on the :? statement. -. Add a semi olon at the end of the S)T statement. .. (la e Muotes around the value on the :? statement. /. Add an )'/ statement to on lude the :? statement. Ans: b 12. The ontents of the raw data file S:O) are listed below: 3333333310333333320333333320 @2 G= The following SAS program is submitted: data test; infile 7siNe7; input 81 height 2. 86 weight 2; run; #hi h one of the following is the value of the variable #):LFT in the output data set, A. 2 -. @2 .. G= /. . 0missing numeri value1 Ans: a 16. A SAS (*:'T pro edure output of the #%*E.>)K)>S data set is listed below: %bs name level 1 ?ranB 1 2 <oan 2 2 Sui 2 6 <ose 2 = -urt 6 9 Eelly . @ <uan 1 The following SAS program is submitted: data worB.e;pertise; set worB.levels; if level ! . then e;pertise ! 7&nBnown7; else if level ! 1 then e;pertise ! 7>ow7; else if level ! 2 or 2 then e;pertise ! 7$edium7; else

e;pertise ! 7Figh7; run; #hi h of the following values does the variable )P()*T:S) ontain, A. >ow5 $edium5 and Figh only -. >ow5 $edium5 and &nBnown only .. >ow5 $edium5 Figh5 and &nBnown only /. >ow5 $edium5 Figh5 &nBnown5 and 7 7 0missing hara ter value1 Ans: b 1=. The ontents of the raw data file )$(>%+)) are listed below: 3333333310333333320333333320 *uth 2G 11 <ose 22 22 Sue 20 22 <ohn 60 66 The following SAS program is submitted: data test; infile 7employee7; input employee_name 4 136; if employee_name ! 7*uth7 then input idnum 10311; else input age @3A; run; #hi h one of the following values does the variable :/'&$ ontain when the name of the employee is Q*uthQ, A. 11 -. 22 .. 22 /. . 0missing numeri value1 Ans: b 19. The ontents of the raw data file )$(>%+)) are listed below: 3333333310333333320333333320 *uth 2G 11 <ose 22 22 Sue 20 22 <ohn 60 66 The following SAS program is submitted: data test; infile 7employee7; input employee_name 4 136; if employee_name ! 7Sue7 then input age @3A; else input idnum 10311; run; #hi h one of the following values does the variable AL) ontain when the name of the employee is QSueQ, A. 20 -. 22 .. 60 /. . 0missing numeri value1 Ans: 1@. The following SAS program is submitted: libname sasdata 7SAS3data3library7;

data test; set sasdata. hemists; if Iob ode ! 7.hem27 then des ription ! 7Senior .hemist7; else des ription ! 7&nBnown7; run; A value for the variable <%-.%/) is listed below: <%-.%/) hem2 #hi h one of the following values does the variable /)S.*:(T:%' ontain, A. .hem2 -. &nBnown .. Senior .hemist /. 7 7 0missing hara ter value1 Ans: b 1A. The following SAS program is submitted: libname sasdata 7SAS3data3library7; data test; set sasdata. hemists; if Iob ode ! 7 hem27 then des ription ! 7Senior .hemist7; else des ription ! 7&nBnown7; run; A value for the variable <%-.%/) is listed below: <%-.%/) .F)$2 #hi h one of the following values does the variable /)S.*:(T:%' ontain, A. hem2 -. &nBnown .. Senior .hemist /. 7 7 0missing hara ter value1 Ans: b 1G. #hi h one of the following %/S statement options terminates output being written to an FT$> file, A. )'/ -. R&:T .. ST%( /. .>%S) Ans: d 20. The following SAS program is submitted: pro means data ! sasuser.shoes; where produ t in 07Sandal7 5 7Slipper7 5 7-oot71; run; #hi h one of the following %/S statements ompletes the program and sends the report to an FT$> file, A. ods html ! 7sales.html7; -. ods file ! 7sales.html7; .. ods file html ! 7sales.html7; /. ods html file ! 7sales.html7;

Ans: d 21. The following SAS program is submitted: pro format; value s ore 1 3 =0 ! 7?ail7 =1 3 100 ! 7(ass7; run; pro report data ! worB. ourses nowd; olumn e;am; define e;am " display format ! s ore.; run; The variable )PA$ has a value of =0.=. Fow will the )PA$ variable value be displayed in the *)(%*T pro edure output, A. ?ail -. (ass .. =0.= /. . 0missing numeri value1 Ans: 22. The following SAS program is submitted: options pageno ! 1; pro print data ! sasuser.houses; run; pro means data ! sasuser.shoes; run; The report reated by the (*:'T pro edure step generates = pages of output. #hat is the page number on the first page of the report generated by the $)A'S pro edure step, A. 1 -. 2 .. = /. 9 Ans: d 22. #hi h one of the following SAS system options displays the time on a report, A. T:$) -. /AT) .. T%/A+ /. /AT)T:$) Ans: b 26. #hi h one of the following SAS system options prevents the page number from appearing on a report, A. '%'&$ -. '%(AL) .. '%'&$-)* /. '%(AL)'&$ Ans: 2=. The following SAS program is submitted: footnote1 7Sales *eport for >ast $onth7; footnote2 7Sele ted (rodu ts %nly7; footnote2 7All *egions7; footnote6 7All ?igures in Thousands of /ollars7;

pro print data ! sasuser.shoes; footnote2 7All (rodu ts7; run; #hi h one of the following ontains the footnote te;t that is displayed in the report, A. All (rodu ts -. Sales *eport for >ast $onth All (rodu ts .. All (rodu ts All *egions All ?igures in Thousands of /ollars /. Sales *eport for >ast $onth All (rodu ts All *egions All ?igures in Thousands of /ollars Ans: b 29. The following SAS program is submitted: pro means data ! sasuser.houses std mean ma;; var sMfeet; run; #hi h one of the following is needed to display the standard deviation with only two de imal pla es, A. Add the option $AP/). ! 2 to the $)A'S pro edure statement. -. Add the statement $AP/). ! @.2; in the $)A'S pro edure step. .. Add the statement ?%*$AT ST/ @.2; in the $)A'S pro edure step. /. Add the option ?%*$AT ! @.2 option to the $)A'S pro edure statement. Ans: a 2@. &nless spe ified5 whi h variables and data values are used to al ulate statisti s in the $)A'S pro edure, A. non3missing numeri variable values only -. missing numeri variable values and non3missing numeri variable values only .. non3missing hara ter variables and non3missing numeri variable values only /. missing hara ter variables5 non3missing hara ter variables5 missing numeri variable values5 and non3 missing numeri variable values Ans: a

2A.

The following SAS program is submitted: pro sort data ! sasuser.houses out ! houses; by style; run; pro print data ! houses; run; .li B on the );hibit button to view the report produ ed. style bedrooms baths pri e .%'/% 2 1.= A00=0 2 2.= @G2=0 6 2.= 12@1=0 2 2.0 110@00 *A'.F 2 1.0 96000 2 2.0 A99=0

2 1.0 AG100 1 1.0 26==0 S(>:T 1 1.0 9=A=0 6 2.0 G66=0 2 1.= @29=0 T#%ST%*+ 6 2.0 10@2=0 2 1.0 ==A=0 2 1.0 9G2=0 6 2.= 102G=0 #hi h of the following SAS statement0s1 reate0s1 the report, A. id style; -. id style; var style bedrooms baths pri e; .. id style; by style; var bedrooms baths pri e; /. id style; by style; var style bedrooms baths pri e; Ans: 2G. A realtor has two ustomers. %ne ustomer wants to view a list of homes selling for less than 4905000. The other ustomer wants to view a list of homes selling for greater than 41005000. Assuming the (*:.) variable is numeri 5 whi h one of the following (*:'T pro edure steps will sele t all desired observations, A. pro print data ! sasuser.houses; where pri e lt 90000; where pri e gt 100000; run; -. pro print data ! sasuser.houses; where pri e lt 90000 or pri e gt 100000; run; .. pro print data ! sasuser.houses; where pri e lt 90000 and pri e gt 100000; run; /. pro print data ! sasuser.houses; where pri e lt 90000 or where pri e gt 100000; run; Ans: b 20. The value 110@00 is stored in a numeri variable. #hi h one of the following SAS formats is used to display the value as 41105@00.00 in a report, A. ommaA.2 -. omma11.2 .. dollarA.2 /. dollar11.2 Ans: d 21. The SAS data set SAS&S)*.F%&S)S ontains a variable (*:.) whi h has been assigned a permanent label of QAsBing (ri eQ. #hi h one of the following SAS programs temporarily repla es the label QAsBing (ri eQ with the label QSale

(ri eQ in the output, A. pro print data ! sasuser.houses; label pri e ! QSale (ri eQ; run; -. pro print data ! sasuser.houses label; label pri e QSale (ri eQ; run; .. pro print data ! sasuser.houses label; label pri e ! QSale (ri eQ; run; /. pro print data ! sasuser.houses label ! QSale (ri eQ; run; Ans: 22. The SAS data set -A'ES is listed below: -A'ES name rate ?irst.apital 0.0@1A /ire t-anB 0.0@21 Kirtual/ire t 0.0@2A The following SAS program is submitted: data newbanB; do year ! 1 to 2; set banBs; apital H =000; end; run; #hi h one of the following represents how many observations and variables will e;ist in the SAS data set ')#-A'E, A. 0 observations and 0 variables -. 1 observations and 6 variables .. 2 observations and 2 variables /. G observations and 2 variables Ans: b 22. The following SAS program is submitted: data worB. lients; alls ! 9; do while 0 alls le 91; alls H 1; end; run; #hi h one of the following is the value of the variable .A>>S in the output data set, A. 6 -. = .. 9 /. @ Ans: d 26. The following SAS program is submitted: data worB.pie es; do while 0n lt 91;

n H 1; end; run; #hi h one of the following is the value of the variable ' in the output data set, A. 6 -. = .. 9 /. @ Ans: 2=. The following SAS program is submitted: data worB.sales; do year ! 1 to =; do month ! 1 to 12; ; H 1; end; end; run; #hi h one of the following represents how many observations are written to the #%*E.SA>)S data set, A. 0 -. 1 .. = /. 90 Ans: b 29. A raw data re ord is listed below: 3333333310333333320333333320 1GGG"10"2= The following SAS program is submitted: data proIe tduration; infile 7file3spe ifi ation7; input date 4 1 3 10; run; #hi h one of the following statements ompletes the program above and omputes the duration of the proIe t in days as of today7s date, A. duration ! today0 1 3 put0date5ddmmyy10.1; -. duration ! today0 1 3 put0date5yymmdd10.1; .. duration ! today0 1 3 input0date5ddmmyy10.1; /. duration ! today0 1 3 input0date5yymmdd10.1; Ans: d 2@. A raw data re ord is listed below: 3333333310333333320333333320 (rinting @=0 The following SAS program is submitted: data bonus; infile 7file3spe ifi ation7; input dept 4 1 3 11 number 12 3 1=; run;

#hi h one of the following SAS statements ompletes the program and results in a value of 7(rinting@=07 for the /)(A*T$)'T variable, A. department ! trim0dept1 number; -. department ! dept input0number52.1; .. department ! trim0dept1 SS put0number52.1; /. department ! input0dept511.1 SS input0number52.1; Ans: 2A. The following SAS program is submitted: data worB.month; date ! put0712mar20007d5ddmmyy10.1; run; #hi h one of the following represents the type and length of the variable /AT) in the output data set, A. numeri 5 A bytes -. numeri 5 10 bytes .. hara ter5 A bytes /. hara ter5 10 bytes Ans: d 2G. The following SAS program is submitted: data worB.produ ts; (rodu t_'umber ! =691; :tem ! 710017; :tem_*eferen e ! :tem7"7(rodu t_'umber; run; #hi h one of the following is the value of the variable :T)$_*)?)*)'.) in the output data set, A. 1001"=691 -. 1001" =691 .. . 0missing numeri value1 /. The value an not be determined as the program fails to e;e ute due to errors. Ans: d 60. The following SAS program is submitted: data worB.retail; ost ! 7200007; total ! .10 J ost; run; #hi h one of the following is the value of the variable T%TA> in the output data set, A. 2000 -. 720007 .. . 0missing numeri value1 /. 7 7 0missing hara ter value1 Ans: a 61. #hi h one of the following SAS statements orre tly omputes the average of four numeri al values, A. average ! mean0num1 3 num61; -. average ! mean0of num1 3 num61; .. average ! mean0of num1 to num61; /. average ! mean0num1 num2 num2 num61; Ans: b

62. The following SAS program is submitted: data worB.test; Author ! 7Agatha .hristie7; ?irst ! substr0s an0author5157 57151511; run; #hi h one of the following is the length of the variable ?:*ST in the output data set, A. 1 -. 9 .. 1= /. 200 Ans: d 62. The following SAS program is submitted: data worB.test; Author ! 7.hristie5 Agatha7; ?irst ! substr0s an0author5257 57151511; run; #hi h one of the following is the value of the variable ?:*ST in the output data set, A. A -. . .. Agatha /. 7 7 0missing hara ter value1 Ans: a 66. The following SAS program is submitted: data worB.test; Title ! 7A Tale of Two .ities5 .harles <. /i Bens7; #ord ! s an0title5257 571; run; #hi h one of the following is the value of the variable #%*/ in the output data set, A. T -. of .. /i Bens /. 7 7 0missing hara ter value1 Ans: b 6=. The following SAS program is submitted: data worB.test; ?irst ! 7:pswi h5 )ngland7; .ity_.ountry ! substr0?irst515@1TT75 7TT7)ngland7; run; #hi h one of the following is the length of the variable .:T+_.%&'T*+ in the output data set, A. 9 -. @ .. 1@ /. 2= Ans: d 69. The following SAS program is submitted: data worB.test; ?irst ! 7:pswi h5 )ngland7;

.ity ! substr0?irst515@1; .ity_.ountry ! .ityTT75 7TT7)ngland7; run; #hi h one of the following is the value of the variable .:T+_.%&'T*+ in the output data set, A. :pswi hTT -. :pswi h5 )ngland .. :pswi h5 7)ngland7 /. :pswi h 5 )ngland Ans: d 6@. #hi h one of the following is true of the *)TA:' statement in a SAS /ATA step program, A. :t an be used to assign an initial value to _'_ . -. :t is only valid in onIun tion with a S&$ fun tion. .. :t has no effe t on variables read with the S)T5 $)*L) and &(/AT) statements. /. :t adds the value of an e;pression to an a umulator variable and ignores missing values. Ans: or d

6A. A raw data file is listed below: 3333333310333333320333333320 1G01 2 1G0= 1 1G10 9 1G2= . 1G61 1 The following SAS program is submitted and referen es the raw data file above: data oins; infile 7file3spe ifi ation7; input year Muantity; run; #hi h one of the following ompletes the program and produ es a non3missing value for the variable T%TR&A'T:T+ in the last observation of the output data set, A. totMuantity H Muantity; -. totMuantity ! sum0totMuantity H Muantity1; .. totMuantity 0; sum totMuantity; /. retain totMuantity 0; totMuantity ! totMuantity H Muantity; Ans: a 6G. A raw data file is listed below: 3333333310333333320333333320 sMuash 1.10 apples 2.2= Iui e 1.9G The following SAS program is submitted using the raw data file above: data gro eries; infile 7file3spe ifi ation7; input item 4 ost; run;

#hi h one of the following ompletes the program and produ es a grand total for all .%ST values, A. grandtot ! sum ost; -. grandtot ! sum0grandtot5 ost1; .. retain grandtot 0; grandtot ! sum0grandtot5 ost1; /. grandtot ! sum0grandtot5 ost1; output grandtot; Ans: =0. The following SAS program is submitted: data worB.total; set worB.salary0Beep ! department wagerate1; by department; if first.department then payroll ! 0; payroll H wagerate; if last.department; run; The SAS data set #%*E.SA>A*+5 urrently ordered by /)(A*T$)'T5 ontains 100 observations for ea h of = departments. #hi h one of the following represents how many observations the #%*E.T%TA> data set ontains, A. = -. 20 .. 100 /. =00 Ans: a =1. The following SAS program is submitted: data worB.total; set worB.salary0Beep ! department wagerate1; by department; if first.department then payroll ! 0; payroll H wagerate; if last.department; run; The SAS data set named #%*E.SA>A*+ ontains 10 observations for ea h department5 urrently ordered by /)(A*T$)'T. #hi h one of the following is true regarding the program above, A. The -+ statement in the /ATA step auses a synta; error. -. ?:*ST./)(A*T$)'T and >AST./)(A*T$)'T are variables in the #%*E.T%TA> data set. .. The values of the variable (A+*%>> represent the total for ea h department in the #%*E.SA>A*+ data set. /. The values of the variable (A+*%>> represent a total for all values of #AL)*AT) in the #%*E.SA>A*+ data set. Ans: 52. The following SAS program is submitted: libname sasdata 'SAS-data-library'; data test; set sasdata.chemists !eep " #ob$code%; if #ob$code " 'chem&' then description " 'Senior 'hemist'; run;

The (ariable )*+$'*,- is a character (ariable with a length of . bytes. /hich one of the following is the length of the (ariable ,-S'012T1*3 in the output data set4 A. . bytes +. 5 bytes '. 67 bytes ,. 288 bytes Ans: c 5&. The following SAS program is submitted: data wor!.accounting; set wor!.dept6 wor!.dept2; run; A character (ariable named )*+'*,- is contained in both the /*09.,-2T6 and /*09.,-2T2 SAS data sets. The (ariable )*+'*,- has a length of 5 in the /*09.,-2T6 data set and a length of : in the /*09.,-2T2 data set. /hich one of the following is the length of the (ariable )*+'*,- in the output data set4 A. 5 +. : '. 5 ,. 62 Ans: a 57. The following SAS ,ATA step is submitted: data wor!.accounting; set wor!.department; length #obcode ; 62; run; The /*09.,-2A0T<-3T SAS data set contains a character (ariable named )*+'*,- with a length of 5. /hich one of the following is the length of the (ariable )*+'*,- in the output data set4 A. 5 +. 5 '. 62 ,. The length can not be determined as the program fails to e=ecute due to errors. Ans: a 55. /hich one of the following SAS statements renames two (ariables4 A. set wor!.dept6 wor!.dept2 rename " #code " #obcode% sal " salary%%; +. set wor!.dept6 wor!.dept2 rename " #code " #obcode sal " salary%%; '. set wor!.dept6 wor!.dept2 rename " #code " #obcode sal " salary%; ,. set wor!.dept6 wor!.dept2 rename " #code #obcode% sal salary%%; Ans: b

5.. The following SAS program is submitted: data wor!.company; set wor!.dept6 !eep " #obcode% wor!.dept2 rename " #code " #obcode%%; run; /hich one of the following is the result4 A. The (ariable )'*,- is written to the output data set. +. The (ariable )*+'*,- is written to the output data set. '. 3either (ariable )'*,- nor )*+'*,- is written to the output data set. ,. The program fails to e=ecute due to errors. Ans: b 5:. The following SAS program is submitted: data wor!.passengers; if *rig2assengers " . then *rig2assengers " 688; Trans2assengers " 688; *rig2assengers " .; 3on2aying " 68; Total2assengers " sum *rig2assengers> Trans2assengers%; run; /hich one of the following is the (alue of the T*TA?2ASS-3@-0S (ariable in the output data set4 A. 688 +. 668 '. 288 ,. . missing numeric (alue% Ans: a 55. The following SAS program is submitted: data wor!.staff; )ob'ategory " 'AA'; )ob?e(el " '6'; )ob'ategory " )ob'ategory BB )ob?e(el; run; /hich one of the following is the (alue of the (ariable )*+'AT-@*0C in the output data set4 A. AA +. AA6 '. AA 6 ,. ' ' missing character (alue% Ans: a 5D. The following SAS program is submitted: data wor!.one; = " &; y " 2; E " = FF y; run; /hich one of the following is the (alue of the (ariable G in the output data set4 A. . +. D '. . missing numeric (alue% ,. The program fails to e=ecute due to errors.

Ans: b .8. The SAS data set named /*09.T-ST is listed below: capacity airplanetype staff 658 ?arge 68 /hich one of the following SAS programs created this data set4 A. data wor!.test; capacity " 658; if 688 le capacity le 288 then airplanetype " '?arge' and staff " 68; else airplanetype " 'Small' and staff " 5; run; +. data wor!.test; capacity " 658; if 688 le capacity le 288 then do; airplanetype " '?arge'; staff " 68; end; else do; airplanetype " 'Small'; staff " 5; end; run; '. data wor!.test; capacity " 658; if 688 le capacity le 288 then do; airplanetype " '?arge'; staff " 68; else do; airplanetype " 'Small'; staff " 5; end; run; ,. data wor!.test; capacity " 658; if 688 le capacity le 288 then; airplanetype " 'Small'; staff " 5; else; airplanetype " '?arge'; staff " 68; run; Ans: b .6. The following SAS program is submitted: data wor!.flights; destination " 'cph'; select destination%; when '?H0'% city " '?ondon';

when ''2H'% city " ''openhagen'; otherwise city " '*ther'; end; run; /hich one of the following is the (alue of the '1TC (ariable4 A. *ther +. 'openh '. 'openhagen ,. ' ' missing character (alue% Ans: a .2. The following SAS program is submitted: data wor!.flights; destination " ''2H'; select destination%; when '?H0'% city " '?ondon'; when ''2H'% city " ''openhagen'; otherwise; end; run; /hich one of the following is the (alue of the '1TC (ariable4 A. ?ondon +. 'openh '. 'openhagen ,. ' ' missing character (alue% Ans: b 92. The following SAS program is submitted: data worB.new; length word 4@; amount ! 6; if amount ! 6 then word ! 7?%&*7; else if amount ! @ then word ! 7S)K)'7; else word ! 7'%')TTT7; amount ! @; run; #hi h one of the following represents the values of the A$%&'T and #%*/ variables, A. amount word @ ?%&* -. amount word @ S)K)' .. amount word 6 ?%&* /. amount word 6 7 7 0missing hara ter value1 Ans: a 96. The SAS data set )$(>%+))_:'?% is listed below: :/'umber );penses 2=62 100.00 2912 122.1= 21GA 226.26

21GA 111.12 The following SAS program is submitted: pro sort data ! employee_info; run; #hi h one of the following -+ statements ompletes the program and sorts the data seMuentially by des ending e;pense values within ea h des ending :/'&$-)* value, A. by des ending :/'umber );penses; -. by 0:/'umber );penses1 des ending; .. by :/'umber des ending );penses des ending; /. by des ending :/'umber des ending );penses; Ans: d 9=. The SAS data set RT*1_*)K)'&) is listed below: destination revenue ++O =2926 ?*A 9212G ?*A @=G92 */& @92=6 ++O A21@6 The following SAS program is submitted: pro sort data ! Mtr1_revenue; by destination des ending revenue; run; #hi h one of the following represents the first observation in the output data set, A. destination revenue ++O A21@6 -. destination revenue ++O =2926 .. destination revenue ?*A 9212G /. destination revenue ?*A @=G92 Ans: d 99. The following SAS program is submitted: libname ompany 7SAS3data3library7; pro sort data ! ompany.payroll; by )mployee:/'umber; run; #rite a ess has been granted to the .%$(A'+ library. #hi h one of the following represents how the observations are sorted, A. .%$(A'+.(A+*%>> is re reated in sorted order by )mployee:/'umber. -. .%$(A'+.(A+*%>> is stored in original order5 and a new data set (A+*%>> is reated in sorted order by )mployee:/'umber. .. .%$(A'+.(A+*%>> is stored in original order5 and a new data set .%$(A'+.(A+*%>>S%*T)/ is reated in sorted order by )mployee:/'umber. /. .%$(A'+.(A+*%>> is re reated in sorted order by )mployee:/'umber5 and a new data set (A+*%>> is reated in sorted order by )mployee:/'umber.

Ans: a 9@. The SAS data set )$(>%+))_:'?% is listed below: :/'umber );penses 2=62 100.00 2912 122.1= 21GA 226.26 21GA 111.12 The following SAS program is submitted: pro sort data ! employee_info; run; #hi h one of the following -+ statements ompletes the program and sorts the data seMuentially by as ending e;pense values within ea h as ending :/'&$-)* value, A. by );penses :/'umber; -. by :/'umber );penses; .. by as ending 0:/'umber );penses1; /. by as ending :/'umber as ending );penses; Ans: b 9A. The SAS data set #%*E.A#A*/S is listed below: fname points Amy 2 Amy 1 Lerard 2 #ang 2 #ang 1 #ang 2 The following SAS program is submitted: pro sort data ! worB.awards; by des ending fname points; run; #hi h one of the following represents how the observations are sorted, A. #ang 2 Lerard 2 #ang 2 Amy 2 #ang 1 Amy 1 -. #ang 2 #ang 2 #ang 1 Lerard 2 Amy 2 Amy 1 .. #ang 2 #ang 1 #ang 2 Lerard 2 Amy 2 Amy 1 /. #ang 1 #ang 2

#ang 2 Lerard 2 Amy 1 Amy 2 Ans: d 9G. The observations in the SAS data set #%*E.T)ST are ordered by the values of the variable 'A$). The following SAS program is submitted: pro sort data ! worB.test out ! worB.testsorted; by name; run; #hi h one of the following is the result of the SAS program, A. The data set #%*E.T)ST is stored in as ending order by values of the 'A$) variable. -. The data set #%*E.T)ST is stored in des ending order by values of the 'A$) variable. .. The data set #%*E.T)STS%*T)/ is stored in as ending order by values of the 'A$) variable. /. The data set #%*E.T)STS%*T)/ is stored in des ending order by values of the 'A$) variable. Ans: @0. #hi h one of the following statements is true regarding the name of a SAS array, A. :t is saved with the data set. -. :t an be used in pro edures. .. :t e;ists only for the duration of the /ATA step. /. :t an be the same as the name of a variable in the data set. Ans: @1. The following SAS program is submitted: data stats; set revenue; array weeBlyC=D mon tue wed thu fri; total ! weeBlyCiD J .2=; output; end; run; #hi h one of the following /% statements ompletes the program and pro esses the elements of the #))E>+ array, A. do i ! 1 to =; -. do weeBlyCiD ! 1 to =; .. do i ! mon tue wed thu fri; /. A /% loop annot be used be ause the variables referen ed do not end in a digit. Ans: a @2. The following SAS program is submitted: data worB.test; array agentsC6D 4 12 sales1 3 sales6; run; #hi h one of the following represents the variables that are ontained in the output data set, A. SA>)S15 SA>)S25 SA>)S25 SA>)S6 -. AL)'TS15 AL)'TS25 AL)'TS25 AL)'TS6 .. 'one5 the /ATA step fails be ause the A**A+ statement an referen e only numeri data. /. 'one5 the /ATA step fails be ause the A**A+ statement an referen e only pre3e;isting variables.

Ans: a @2. The following SAS program is submitted: data worB.test; set worB.staff 0Beep ! Iansales febsales marsales1; array diff_salesC2D difsales1 3 difsales2; array monthlyC2D Iansales febsales marsales; run; #hi h one of the following represents the new variables that are reated, A. <A'SA>)S5 ?)-SA>)S and $A*SA>)S -. $%'TF>+15 $%'TF>+2 and $%'TF>+2 .. /:?SA>)S15 /:?SA>)S2 and /:?SA>)S2 /. /:??_SA>)S15 /:??_SA>)S2 and /:??_SA>)S2 Ans: @6. %n whi h portion0s1 of a SAS data set does the (*:'T pro edure report, A. the data portion only -. the des riptor portion only .. the des riptor portion and the data portion /. neither the data portion nor the des riptor portion Ans: a @=. #hi h one of the following SAS pro edures displays the data portion of a SAS data set, A. (*:'T -. ?S>:ST .. .%'T)'TS /. /ATAS)TS Ans: a @9. The following SAS program is submitted: pro datasets lib ! sasuser; ontents data ! lass varnum; Muit; #hi h one of the following is the purpose of the KA*'&$ option, A. to print a list of variable names -. to print the total number of variables .. to print a list of the variables in alphabeti order /. to print a list of the variables in the order they were reated Ans: d @@. The following SAS program is submitted: pro ontents data ! sasuser.airplanes; run; #hi h one of the following is produ ed as output, A. the data portion of every data set in the SAS&S)* library -. the data portion of the data set SAS&S)*.A:*(>A')S only .. the des riptor portion of every data set in the SAS&S)* library /. the des riptor portion of the data set SAS&S)*.A:*(>A')S only Ans: d

@A. A raw data file is listed below: 3333333310333333320333333320 <ohn $ .losBey 2= @1 <une *osesette 10 62 TineBe <ones G 2@ The following SAS program is submitted using the raw data file as input: data worB.homeworB; infile 7file3spe ifi ation7; input name 4 age height; if age >) 10; run; Fow many observations will the #%*E.F%$)#%*E data set ontain, A. 0 -. 2 .. 2 /. 'o data set is reated as the program fails to e;e ute due to errors. Ans: b @G. The SAS/ATA.-A'ES data set has five observations when the following SAS program is submitted: libname sasdata 7SAS3data3library7; data allobs; set sasdata.banBs; apital!0; do year ! 2000 to 2020 by =; apital H 00 apitalH20001 J rate1; output; end; run; Fow many observations will the A>>%-S data set ontain, A. = -. 1= .. 20 /. 2= Ans: d A0. The SAS data set named .%$(A'+.(*:.)S is listed below: .%$(A'+.(*:.)S prodid pri e produ ttype sales returns E12S =.10 ')T#%*E 1= 2 -122S 2.26 FA*/#A*) 200 10 *1AE+2 1.2G S%?T#A*) 2= = 2E>A-+ 9.2@ FA*/#A*) 12= 1= /+9=/# =.90 FA*/#A*) 6= = /LT+22 6.== FA*/#A*) 9@ 2 The following SAS program is submitted: libname ompany 7SAS3data3library7; data hware inter soft; set ompany.pri es 0Beep ! produ ttype pri e1; if pri e le =.00; if produ ttype ! 7FA*/#A*)7 then output F#A*); else if produ ttype ! 7')T#%*E7 then output :'T)*; else if produ ttype ! 7S%?T#A*)7 then output S%?T; run;

Fow many observations does the F#A*) data set ontain, A. 0 -. 2 .. 6 /. 9 Ans: b A1. The following SAS program is submitted: data allobs; set sasdata.origin 0firstobs ! @= obs ! 6GG1; run; The SAS data set SAS/ATA.%*:L:' ontains 1000 observations. Fow many observations does the A>>%-S data set ontain, A. 626 -. 62= .. 6GG /. 1000 Ans: b A2. The following SAS program is submitted: data _null_; set old 0Beep ! prod sales1 sales21; file 7file3spe ifi ation7; put sales1 sales2; run; #hi h one of the following default delimiters separates the fields in the raw data file reated, A. : 0 olon1 -. 0spa e1 .. 5 0 omma1 /. ; 0semi olon1 Ans: b A2. The following SAS program is submitted: data _null_; set old; put sales1 sales2; run; #here is the output written, A. the SAS log -. the raw data file that was opened last .. the SAS output window or an output file /. the data set mentioned in the /ATA statement Ans: a A6. The ontents of the raw data file T)A$ are listed below: 3333333310333333320333333320 <ani e 10 Fenri 11 $i hael 11 Susan 12 The following SAS program is submitted:

data group; infile 7team7; input name 41=. age 2.; file 7file3spe ifi ation7; put name 41=. H= age 2.; run; #hi h one of the following des ribes the output reated, A. a raw data file only -. a SAS data set named L*%&( only .. a SAS data set named L*%&( and a raw data file /. 'o output is generated as the program fails to e;e ute due to errors. Ans: A=. The ontents of the SAS data set named ()*$.ST&/)'TS are listed below: name age Alfred 16 Ali e 12 -arbara 12 .arol 16 The following SAS program is submitted using the ()*$.ST&/)'TS data set as input: libname perm 7SAS3data3library7; data students; set perm.students; file 7file3spe ifi ation7; put name 41=. 8= age 2.; run; #hi h one of the following represents the values written to the output raw data file, A. 3333333310333333320333333320 Alfred 16 Ali e 12 -arbara 12 .arol 16 -. 3333333310333333320333333320 Alfr16 Ali 12 -arb12a .aro16 .. 3333333310333333320333333320 Alfr16ed Ali 12e -arb12ara .aro16l /. 3333333310333333320333333320 Alfred 16 Ali e 12 -arbara 12 .arol 16 Ans: b A9. The ontents of the SAS data set ()*$.<A'_SA>)S are listed below: KA*:A->) 'A$) T+() idnum hara ter variable sales_date numeri date value

A omma delimited raw data file needs to be reated from the ()*$.<A'_SA>)S data set. The SA>)S_/AT) values need to be in a $$//++10 form. #hi h one of the following SAS /ATA steps orre tly reates this raw data file, A. libname perm 7SAS3data3library7; data _null_; set perm.Ian_sales; file 7file3spe ifi ation7 dsd ! 757; put idnum sales_date : mmddyy10.; run; -. libname perm 7SAS3data3library7; data _null_; set perm.Ian_sales; file 7file3spe ifi ation7 dlm ! 757; put idnum sales_date : mmddyy10.; run; .. libname perm 7SAS3data3library7; data _null_; set perm.Ian_sales; file 7file3spe ifi ation7; put idnum sales_date : mmddyy10. dlm ! 757; run; /. libname perm 7SAS3data3library7; data _null_; set perm.Ian_sales; file 7file3spe ifi ation7; put idnum sales_date : mmddyy10. dsd ! 757; run; Ans: b A@. A raw data re ord is shown below: 0@<an2002 #hi h one of the following informats would read this value and store it as a SAS date value, A. dateG. -. ddmonyyG. .. dd$$$yyG. /. ddmmmyyyyG. Ans: a AA. The following SAS program is submitted: libname temp 7SAS3data3library7; data worB.new; set temp.Iobs; format newdate mmddyy10.; Mdate ! Mtr0newdate1; ddate ! weeBday0newdate1; run; pro print data ! worB.new; run; The variable ')#/AT) ontains the SAS date value for April 1=5 2000. #hat output is produ ed if April 1=5 2000 falls on a Saturday, A. %bs newdate Mdate ddate 1 A(*1=2000 2 9

-. %bs newdate Mdate ddate 1 06"1="2000 2 9 .. %bs newdate Mdate ddate 1 A(*1=2000 2 @ /. %bs newdate Mdate ddate 1 06"1="2000 2 @ Ans: d AG. The following SAS program is submitted: data worB.report; set worB.sales_info; if Mtr0sales_date1 ge 2; run; The SAS data set #%*E.SA>)S_:'?% has one observation for ea h month in the year 2000 and the variable SA>)S_/AT) whi h ontains a SAS date value for ea h of the twelve months. Fow many of the original twelve observations in #%*E.SA>)S_:'?% are written to the #%*E.*)(%*T data set, A. 2 -. 2 .. 9 /. G Ans: G0. The following SAS program is submitted: data revenue; set year_1; var1 ! mdy0151=51G901; run; #hi h one of the following values does the variable named KA*1 ontain, A. 16 -. 1= .. 11=1G90 /. 71"1="1G907 Ans: a G1. The following SAS program is submitted: data worB.new; mon ! 2; day ! 22; year ! 2000; date ! mdy0mon5day5year1; run; #hi h one of the following is the value of the /AT) variable, A. a hara ter string with the value 722mar20007 -. a hara ter string with the value 702"22"20007 .. a numeri value of 169G25 whi h represents the SAS date value for $ar h 225 2000 /. a numeri value of 22220005 whi h represents the SAS date value for $ar h 225 2000 Ans:

G2. The following SAS /ATA step e;e utes on $onday5 April 2=5 2000: data newstaff; set staff; start_date ! today01; run; #hi h one of the following is the value of the variable STA*T_/AT) in the output data set, A. a hara ter string with the value 706"2="20007 -. a hara ter string with the value 7$onday5 April 2=5 20007 .. the numeri value 16@2=5 representing the SAS date for April 2=5 2000 /. the numeri value 062=20005 representing the SAS date for April 2=5 2000 Ans: G2. The following SAS /ATA step is submitted: data sasdata.atlanta sasdata.boston worB.portland worB.phoeni;; set ompany.prdsales; if region ! 7')7 then output boston; if region ! 7S)7 then output atlanta; if region ! 7S#7 then output phoeni;; if region ! 7'#7 then output portland; run; #hi h one of the following is true regarding the output data sets, A. 'o library referen es are reMuired. -. The data sets listed on all the :? statements reMuire a library referen e. .. The data sets listed in the last two :? statements reMuire a library referen e. /. The data sets listed in the first two :? statements reMuire a library referen e. Ans: d G6. #hi h one of the following SAS /ATA steps saves the temporary data set named $+/ATA as a permanent data set, A. libname sasdata 7SAS3data3library7; data sasdata.mydata; opy mydata; run; -. libname sasdata 7SAS3data3library7; data sasdata.mydata; Beep mydata; run; .. libname sasdata 7SAS3data3library7; data sasdata.mydata; save mydata; run; /. libname sasdata 7SAS3data3library7; data sasdata.mydata; set mydata; run; Ans: d G=. The following SAS /ATA step is submitted: libname temp 7SAS3data3library7;

data temp.report; set sasuser.houses; newvar ! pri e J 1.06; run; #hi h one of the following statements is true regarding the program above, A. The program is reading from a temporary data set and writing to a temporary data set. -. The program is reading from a temporary data set and writing to a permanent data set. .. The program is reading from a permanent data set and writing to a temporary data set. /. The program is reading from a permanent data set and writing to a permanent data set. Ans: d G9. The following SAS S%*T pro edure step generates an output data set: pro sort data ! sasuser.houses out ! report; by style; run; :n whi h library is the output data set stored, A.#%*E -.*)(%*T. ..F%&S)S /.SAS&S)* Ans: a G@. The following SAS program is submitted: pro sort data!worB.employee; by des ending fname; pro sort data!worB.salary; by des ending fname; data worB.empdata; merge worB.employee worB.salary; by fname; run; #hi h one of the following statements e;plains why the program failed e;e ution, A. The S%*T pro edures ontain invalid synta;. -. The merged data sets are not permanent SAS data sets. .. The data sets were not merged in the order by whi h they were sorted. /. The *&' statements were omitted after ea h of the S%*T pro edures. Ans: GA. The SAS data sets #%*E.)$(>%+)) and #%*E.SA>A*+ are shown below: #%*E.)$(>%+)) #%*E.SA>A*+ fname age name salary -ru e 20 -ru e 2=000 /an 60 -ru e 2=000 /an 2=000 The following SAS program is submitted: data worB.empdata; by fname; totsal H salary; run; #hi h one of the following statements ompletes the merge of the two data sets by the ?'A$) variable,

A. merge worB.employee worB.salary 0fname ! name1; -. merge worB.employee worB.salary 0name ! fname1; .. merge worB.employee worB.salary 0rename ! 0fname ! name11; /. merge worB.employee worB.salary 0rename ! 0name ! fname11; Ans: d GG. The SAS data sets #%*E.)$(>%+)) and #%*E.SA>A*+ are listed below: #%*E.)$(>%+)) #%*E.SA>A*+ fname age fname salary -ru e 20 -ru e 2=000 /an 60 -ru e 2=000 /an 2=000 The following SAS program is submitted: data worB.empdata; merge worB.employee worB.salary; by fname; totsal H salary; run; Fow many variables are output to the #%*E.)$(/ATA data set, A. 2 -. 6 .. = /. 'o variables are output to the data set as the program fails to e;e ute due to errors. Ans: b 100.The ontents of two SAS data sets named )$(>%+)) and SA>A*+ are listed below: )$(>%+)) SA>A*+ name age name salary -ru e 20 -ru e 60000 /an 2= -ru e 2=000 /an 2@000 /an . The following SAS program is submitted: data worB.empsalary; merge worB.employee 0in ! inemp1 worB.salary 0in ! insal1; by name; if inemp and insal; run; Fow many observations will the data set #%*E.)$(SA>A*+ ontain, A. 2 -. 6 .. = /. 9 Ans: b

101.The following SAS program is submitted: data worB.empsalary; set worB.people 0in ! inemp1 worB.money 0in ! insal1; if insal and inemp; run; The SAS data set #%*E.()%(>) has = observations5 and the data set #%*E.$%')+ has @ observations. Fow many observations will the data set #%*E.)$(SA>A*+ ontain, A. 0 -. = .. @ /. 12 Ans: a 101. The following SAS program is submitted: data numre ords; infile 7file3spe ifi ation7; input 81 patient 41=. relative 4 19329 8; :f relative ! 7 hildren7 then input 8=6 diagnosis 41=. 8; else if relative ! 7parents7 then input 82A do tor 41=. lini 4 663=2 8=6 diagnosis 41=. 8; input age; run; Fow many raw data re ords are read during ea h iteration of the /ATA step during e;e ution, A. 1 -. 2 .. 2 /. 6 Ans: a 102. A raw data file is listed below: *A'.F512=052515Sheppard Avenue5Q4965000Q S(>:T511G051515*and Street5Q49=5A=0Q .%'/%516005251.=5$arBet Street5QA050=0Q T#%ST%*+51A1056525Larris Street5Q410@52=0Q *A'.F51=0052525Eemble Avenue5Q4A959=0Q S(>:T5191=56525#est /rive5QG656=0Q S(>:T5120=5251.=5Lraham Avenue5Q4@259=0Q The following SAS program is submitted using the raw data file as input: data worB. ondo_ran h; infile 7file3spe ifi ation7 dsd; input style 4 8; if style ! 7.%'/%7 or style ! 7*A'.F7; input sMfeet bedrooms baths street 4 pri e : dollar10.; run; Fow many observations will the output data set ontain, A. 0 -. 2

.. = /. @ Ans: b 102. A raw data file is listed below: *A'.F512=052515Sheppard Avenue5Q4965000Q S(>:T511G051515*and Street5Q49=5A=0Q .%'/%516005251.=5$arBet Street5QA050=0Q T#%ST%*+51A1056525Larris Street5Q410@52=0Q *A'.F51=0052525Eemble Avenue5Q4A959=0Q S(>:T5191=56525#est /rive5QG656=0Q S(>:T5120=5251.=5Lraham Avenue5Q4@259=0Q The following SAS program is submitted using the raw data file as input: data worB. ondo_ran h; infile 7file3spe ifi ation7 dsd; input style 4 8; if style ! 7.%'/%7 or style ! 7*A'.F7 then input sMfeet bedrooms baths street 4 pri e : dollar10.; run; Fow many observations does the #%*E..%'/%_*A'.F data set ontain, A. 0 -. 2 .. = /. @ Ans: d 106. The ontents of the raw data file ?&*':T&*) are listed below: 3333333310333333320333333320 hair55table hair5 ou h5table The following SAS program is submitted: data sto B; infile 7furniture7 dsd; input item1 4 item2 4 item2 4; run; #hi h one of the following is the value of the variable named :T)$2 in the first observation of the output data set, A. table -. 5table .. . 0missing numeri value1 /. 7 7 0missing hara ter value1 Ans: d 10=. The following SAS program is submitted: libname rawdata1 7lo ation of SAS data library7; filename rawdata2 7lo ation of raw data file7; data worB.testdata; infile input sales1 sales2; run; #hi h one of the following is needed to omplete the program orre tly, A. rawdata1

-. rawdata2 .. 7rawdata17 /. 7rawdata27 Ans: b 109. A raw data re ord is listed below: 3333333310333333320333333320 son5Travis5 The following output is desired: relation firstname son Travis #hi h one of the following SAS programs reads the data orre tly, A. data family " dlm ! 757; infile 7file3spe ifi ation7; input relation 4 firstname 4; run; -. options dlm ! 757; data family; infile 7file3spe ifi ation7; input relation 4 firstname 4; run; .. data family; infile 7file3spe ifi ation7 dlm ! 757; input relation 4 firstname 4; run; /. data family; infile 7file3spe ifi ation7; input relation 4 firstname 4 " dlm ! 757; run; Ans: 10@. The ontents of the raw data file T+().%>%* are listed below: 3333333310333333320333333320 daisyyellow The following SAS program is submitted: data flowers; infile 7type olor7; input type 4 13= H1 olor 4; run; #hi h one of the following represents the values of the variables T+() and .%>%*, A. type olor daisy yellow -. type olor daisy ellow .. type olor daisyyellow 0missing hara ter value1 /. 'o values are stored as the program fails to e;e ute due to synta; errors. Ans: b 10A. The ontents of the raw data file (*%/&.T are listed below: 3333333310333333320333333320 26912 42=.21

The following SAS program is submitted: data inventory; infile 7produ t7; input idnum =. 810 pri e; run; #hi h one of the following is the value of the (*:.) variable, A. 2=.21 -. 42=.21 .. . 0missing numeri value1 /. 'o value is stored as the program fails to e;e ute due to errors. Ans: 10G. The following SAS program is submitted: pro print data ! sasuser.houses; run; pro means data ! sasuser.shoes; run; #hi h one of the following %(T:%'S statements resets the page number to 1 for the se ond report, A. options pageno ! 1; -. options pagenum ! 1; .. options reset pageno ! 1; /. options reset pagenum ! 1; Ans: a 110. The following SAS program is submitted: data worB.sets; do until 0prod gt 91; prod H 1; end; run; #hi h one of the following is the value of the variable (*%/ in the output data set, A. = -. 9 .. @ /. A Ans: 111. #hi h one of the following is true of the S&$ statement in a SAS /ATA step program, A. :t is only valid in onIun tion with a S&$ fun tion. -. :t is not valid with the S)T5 $)*L) and &(/AT) statements. .. :t adds the value of an e;pression to an a umulator variable and ignores missing values. /. :t does not retain the a umulator variable value from one iteration of the SAS /ATA step to the ne;t. Ans: 112. The following SAS program is submitted: data worB.new; length word 4@; amount ! @; if amount ! = then word ! 7.AT7; else if amount ! @ then word ! 7/%L7;

else word ! 7'%')TTT7; amount ! =; run; #hi h one of the following represents the values of the A$%&'T and #%*/ variables, A. amount word = /%L -. amount word = .AT .. amount word @ /%L /. amount word @ 7 7 0missing hara ter value1 Ans: a 112. #hen the following SAS program is submitted5 the data set SAS/ATA.(*/SA>)S ontains =000 observations: libname sasdata 7SAS3data3library7; options obs ! =00; pro print data ! sasdata.prdsales 0firstobs ! 1001; run; options obs ! ma;; pro means data ! sasdata.prdsales 0firstobs ! =001; run; Fow many observations are pro essed by ea h pro edure, A. 600 for (*%. (*:'T 6=00 for (*%. $)A'S -. 601 for (*%. (*:'T 6=01 for (*%. $)A'S .. 601 for (*%. (*:'T 6=00 for (*%. $)A'S /. =00 for (*%. (*:'T =000 for (*%. $)A'S Ans: b 116. :n the following SAS program5 the input data files are sorted by the 'A$)S variable: libname temp 7SAS3data3library7; data temp.sales; merge temp.sales worB.re eipt; by names; run; #hi h one of the following results o urs when this program is submitted, A. The program e;e utes su essfully and a temporary SAS data set is reated. -. The program e;e utes su essfully and a permanent SAS data set is reated. .. The program fails e;e ution be ause the same SAS data set is referen ed for both read and write operations. /. The program fails e;e ution be ause the SAS data sets on the $)*L) statement are in two different libraries. Ans: b 11=. data samp ; a=RAMA; b=1758;

c=a||b; run; What will be the value in c? a RAMA1758 b RAMA numeric" Ans# a 11$" data emp; ename=RAMA%A&'( s=substr)scan)ename*1 *1*1 ; run; What is the len+th !, a variable s in the ab!ve step? a. - b 1 c 8 d .//" Ans: d 117. data x; input a $ b; cards; $ 250 $100 ; What will be the value of b in the above step? a)$100 b)100 c) . d) character ans# c 120. data0null0; set emp; 1ut 21en!3" 25ename41/" 2./ sal 7"; run; Which stmt bel!w is true re+ardin+ ab!ve step? a. it writes the c!ntents !, emp t! sas l!+" issin!"; 1758 c RAMA 1758 d err!r because we cant c!ncatenate character and

b. &t writes the c!ntents t! recentl5 assi+ned ,ilere," . 65nta7 err!r bc!8 ,ile stmt is n!t present" d. %!ne !, the ab!ve" Ans:A 121. data emp; d! until)795 ; 7:1; end; run; What will be the value !, 7 in the dataset? a 5 b $ c 7 d 1" $ns# b 122. data emp; 7=$ d! while)7;$ ; 7:1; end; run; a 7=" b 7=1 c 7=$ d 7=5 " ans# c 122. pr!c s!rt data=ram"emp; b5 en!; run; Which stmt is true re+ardin+ ab!ve step? a it st!res the s!rted data in a temp!rar5 dataset emp b it replaces the same dataset with s!rted data

c it creates the emps!rt dataset with s!rted data in ramalibrar5 d n!ne !, the ab!ve

126. which steps s!rts the data c!rrectl5? a. pr!c s!rt data=emp; b5 descendin+ )dept sal ; run; b. pr!c s!rt data=emp; b5 descendin+ dept descendin+ sal; run; . pr!c s!rt data=emp; b5 descendin+ )dept sal ; run; d. pr!c s!rt data=emp; b5 descendin+ )dept *sal ; run; 125. data e p; %nput date &'.(; )ards; 1**7+07+15 ; Which infor at is user to read the above data.

$ns# ,,

dd10.

12-. data sa p; .et e p/0eep 1a b c d e); %f a1100 then d150;

2eep a b; 3un; 4ow an, variable will be written to dataset sa p;

5nl, a6 b 127. data e p; .et e pd/in1a) e p/in1b); %f a and b; 3un; $ssu e that a contains 5 and b contains - obs. 4ow $ns# 127. data 8null8; $1 d,/10959*-); :ut a; 3un; What is the value of a? $ns#1;<27 12*. =ata 8null8; %nput a; )ards; $29;<5 ; What is the value of 8error8 in the step? $ns#1 1;0. Which step below is correct? a) data e p; %nfile cards dl 1>9>; %nput eno ena e $; an, records will be written to the o+p dataset e p;

)ards; 111 suresh ; b) =ata e p dl 1>9>; %nfile cards; %nput eno ena e $; )ards; 111 suresh ; $ns# a 1;1. Which for at will displa, the nu ber *-77 in *9-77 for at? $ns# co a5.

1;2. =ata ? p; %nfile @c#Ae p.txt>; %nput Bstatus $;. B; %f status1>raC> then Dhen inputB< sales co a<. B;

?lse input B< sales dollar5.B; %nput predict; 3un; 4ow an, records will be read b, the above step in one iteration?

1;;. proc freE data1e p; a. Dables deptno9sal; b. tables deptno sal ; c. tables deptno; d. Dables sal; 3un;

1;<. Which one below produce tabular o+p. :roc freE data1?F:; a. b. c. 3un; 1;5. data percent/drop1i Etr1HEtr<); .et donate; Dotal1su /of Etr1HEtr2); $rra, conribI<J Etr1HEtr<; $rra, percent/<); =o i11 to <; :ercent /i)1contrib./i)+total; ?nd; 3un; What variables will be created in the o+p dataset? $ns# total9 percent19percent29percent;9percent<. 1;-. =ata ?F:; .et e p1; Dotal8sal; $ssu e that e p1 has ; variables 4ow an, variables will be there in the e p after co pilation? Dables detnoGsal; b. tables deptno9sal c. tables deptno.sal;

1;7. Which st t !enerate the value 7 in the variable a? a) a12G; b) a12GG; c) a1;GG2 d)none

1;7. What is the len!th of the variable a? =ata e p; $1>17*7>; 3un; $ns# <

1;*. =ata e p1; .et ?F:; Where eno1111; Where eno1112; Which where st t will be affected to o+p dataset? Kast where state ent 112 1<0. =ata e p; %nput eno; )ards; H12; ; What will be the value of eno is the e p; $ns# H12; 161. #hi h portion of the dataset will display when we run a (*%. (*:'T pro edure, Ans: data portion 1<2. =ata ?F:; .et ?F:; L, deptno; %f first .deptno then DotalMsal; %f last.deptno;

3un; $ns# totalsal contains sal for each deptno; /in this he has !iven one %n one dept 50 e pl,ees there and out of 50 dept nos how 1<;. =ata ?F:; %nfile @c#Asal.txt> end1eof; &include st t( 3un; Which st t causes sas to write onl, the last record into dataset? $ns# eof11 1<<. =ata x; Ken!th ena e $20; %nfile cards dsd; )ards; 1119"suresh90u ar"9<00 1;29"anC90u ar"9;00 ; Which step re!ardin! above step is true? a. it reads orre tly b1it reMuires dlm 1it wonUt read orre tly d1synta; error 1<5. =ata su .et te ps; %f te (100 then status1>hot>; ?lse status1>cold>; 3un; De p 100 50 What is the value of status for the second record? $ns# cold 1<-. =ata a; er; ore Euestion as no.s li0e

an, records will be updated?)

%nput a b; )1a+b; )ards; 10 . 0 ;0 . 12 1< . Nalues of ) in the dataset. $ns# .909.9. 1<7. %f there is an error in 8n8 then what will be the value of the 8error8 and What is the value of it in the next st t of 8n8; 1<7. =ata !en; =o i11 to -; O1xGG2; ?nd; 3un; What is the o+p; $ns# i179 ,1. 9x1. 1<*. =ata e p; Nar1>fa>; Nar11>1>; Nar1varPPvar1; 3un; What is the value of var in o+p dataset? $ns# fa 150. Which step below is ri!ht? 1) set e p /rena e1/eno1e pno)/ena e1e pna e)); 2) set e p/rena e1/eno1e pno ena e1e pna e));

;) set e p/rena e1/eno1e pno9ena e1e pna e)); 1=1. #hi h SAS fun tion below returns an argument with leading blanBs moved to the end of the value, 1. *:LFT 2. T*:$ 2. >)'LTF 6. <&ST:?+ =. >)?T 1=2. #hat is one of the uses of a Q8Q when reading a file in a /ATA step, 1. To trim the spa e to the right of a hara ter variable in the :'(&T statement 2. To reate a SAS onstant 2. To hold a re ord in the input buffer for further pro essing 6. To test the relationship between two values =. To separate elements of a hara ter string 1=2. #hen a /ATA step is submitted5 in what order are data set options and /ATA step statements pro essed, 1. %ptions on :'(&T data sets5 then options on %&T(&T data sets5 then STAT)$)'TS 2. %ptions on STAT)$)'TS5 then options on %&T(&T data sets5 then options on :'(&T data sets 2. %ptions on STAT)$)'TS5 then options on :'(&T data sets5 then options on %&T(&T data sets 6. %ptions on %&T(&T data sets5 then STAT)$)'TS5 then options on :'(&T data sets =. %ptions on :'(&T data sets5 then STAT)$)'TS5 then options on %&T(&T data sets 1=6. #hi h (*%. below is used to a Muire des riptor information about a data set, 1. (*%. STAT:ST:.S 2. (*%. $)A'S 2. (*%. .%'T)'TS 6. (*%. /)S.*:(T:%' =. (*%. .ATA>%L 1==. #hat is the effe t of the SAS statement %(T:%'S $:SS:'L!, 1. :t spe ifies the hara ter to be printed for missing numeri variables. 2. :t indi ates whether or not the /ATA step is to a for yes1. ount for missing values in a (*%. statement 00 for no and 1

2. :t aborts a program if missing values are en ountered during /ATA step pro essing. 6. :t ontrols the ma;imum number of missing values whi h will be written to a data set. =. :t ontrols whether or not missing variables are written to the data set. 1=9. /ata Set ?ruit /ata Set Keggie

%-S KA*1 1 2 2 6 a b

?ruit 1 2 2

%-S KA*1 a b bean pea orn

Keggie

banana melon grape grape

:f data set ?*&:T and data set K)LL:) are on atenated to reate data set -%TF5 how many observations would data set -%TF ontain, 1. 2. 2. 6. =. Two Three ?our ?ive Seven

1=@. #hi h %(T:%' Beyword on a (*%. S&$$A*+ spe ifies to output only the observations with the highest _T+()_ value to a data set, 1. $:SS:'L 2. $AP/). 2. :/$:' 6. %*/)*!data =. '#A+ 1=A. :? .:T+!:7A7; #hat does the SAS statement above do, 1. 2. 2. 6. =. :f there is an A anywhere in the ity variable5 it sele ts that observation. :t sele ts all ities that ontain an a in the value. :f a S.A' of the variable ity indi ates a hara ter value5 it sele ts that observation. :t sele ts those observations with ities beginning with an A. :t formats the variable ity with a trailing blanB.

1=G. A programmer wants to read rows 100 through 200 of an e;ternal file. #hi h of the following infile statements should she use, 1. 2. 2. 6. =. infile ; obs!100 lastobs!200; infile ; firstobs!101 lastobs!201; infile ; obs!101 lastobs!200; infile ; firstobs!101 obs!201; infile ; firstobs!100 obs!200;

190. #hi h %(T:%' statement below will enter a printout, 1. <&ST:?+!?&>> 2. '%.)'T)*%?? 2. .)'T)*%' 6. .)'T)* =. <&ST:?+!.)'T)* 191. data a; set ;; run;

options obs!=; data b; set ;; run;

data ; set ;; output; output; run; Assuming data set P ontains seven observations in the sample ode above5 what are the number of observations that are written respe tively to the data sets A5 -5 and ., 1. =5=5=

2. 2. 6.

=5@5= @5@5= @5=5=

192. #hi h numeri :'?%*$AT below onverts blanBs to Neros, 1. -:TSw.d 2. -Ow.d 2. ->O*w.d 6. 4F)Pw. =. -:'A*+w.d 192. :n A**A+ pro essing5 what does the /:$ fun tion do, 1. :t spe ifies the lower bound of an impli it array. 2. :t defines an impli it array. 2. :t suppresses the output of an impli it array in data set pro essing. 6. :t assigns a subs ript to ea h of the array elements. =. :t returns the number of elements in a dimension of an array. 196. #hi h date fun tion below returns the number of time intervals in a given time span, 1. :'T'P 2. :'T.E 2. :'T** 6. $/+ =. A-S. 19=. data test; input 81 ; 4@. 81 y date@. 8A mm 2. 810 dd 2. 812 yy 2.; N ! mdy 0mm5 dd5 yy1; format y N mmddyy10.; ards; 01S)(000G0100 02A&LGG0A02GG 0=%.TAA100=AA 26'%KGG1126GG

; pro sort data!test out!test1; by ;; pro sort data!test out!test2; by y; pro sort data!test out!test2; by N; pro print data!test1; pro print data!test2; pro print data!test2; run; Assume that 00 is the yy value for 2000 and the SAS system options are set to SAS Kersion9 default values. #hi h data set in the sample ode above 0T)ST1 or T)ST2 or T)ST21 will ontain dates sorted in the e;pe ted as ending order, 1. 2. 2. 6. =. T)ST1 %nly T)ST2 %nly T)ST2 %nly -oth T)ST2 and T)ST2 'one of the above

199. Vlet >:-!#%*E; Vlet /S'!T)ST;

(*%. print data!W>:-.W/S'; run; #hat needs to be done in order to print data set #%*E.T)ST, 1. 2. 2. 6. =. +ou must put W>:- in V'*ST*01. +ou must put W/S' in VST*01. +ou must add a period. +ou must add %(T:%'S />$!7.7 before the (*%. step. 'othing 3 the sample ode is orre t. argument

19@. #hi h fun tion below returns a remainder when an integer Muotient of argument one divided by two is al ulated, 1. A-S 2. $%/ 2. '$:SS

6. $:' =. *A'&': 19A. data test; infile ards; input X2 81 ; 46. "" 81 y 46.; ards; 1226 =9@A G012 26=9 @AG0 ; pro print; run; #hat is the output of the sample ode above, .hoi e 1 %-S 1 2 G012 1226 P +

G012 1226

.hoi e 2 %-S 1 G012 P +

26=9

.hoi e 2 %-S 1 2 =9@A 1226 P +

26=9 =9@A

.hoi e 6 %-S 1 2 2 =9@A 1226 1226 P +

26=9 =9@A G012

.hoi e = %-S 1 =9@A P +

26=9

19G. #hi h of the following statements is true on erning (*%. SR>, 1. SR> an sort and summariNe5 but a (*%. (*:'T is ne essary in order to get a printout of a Iob. 2. /ire t a ess by (%:'T)*! ontrol is available.

2. SR> an sort5 summariNe5 and print in one (*%.. 6. /ata needs to be sorted. =. #F)*) statements are not permitted in SR>. 1@0. #hi h of the following statements omparing (&T and %&T(&T statements is valid, 1. %&T(&T writes observations to a SAS data set. (&T writes variable values or te;t to a SAS output file or to an e;ternal file. 2. %&T(&T statements must be in luded in a /ATA step if the data is to be written to a data set5 but a (&T statement is not needed to write to a flat file. 2. %&T(&T results are raw data written to an e;ternal file5 but (&T results are SAS data sets. 6. The %&T(&T statement is e;pli it in a /ATA step when writing to a SAS data set5 but the (&T statement is impli it in /ATA step pro essing. =. 'one of the above are true. 1@1. data _null_; ;!1"2; if ;!.2222 then put 7fra tion7; #ill the (&T statement in the sample ode above write out 7fra tion75 and if not5 what ode must be used, 1. 2. 2. 6. =. +es. 'o. if A-S0;5.00011!.2222 then 'o. if *%&'/0;5.00011!.2222 then 'o. if $%/0;521!0 then 'o. if (&T0;5.000011!.2222 then

1@2. #hi h statement below assigns a value produ ed in a /ATA step to a ma ro variable, 1. VS+S>(&T 2. VS)T 2. VS+S.A>>

6. .A>> S+$(&T =. V)KA> 1@2. #hi h statement sele ts observations to be pro essed in a (*%. step, 1. #F)*) 2. TF)' 2. :? 6. #F)' =. :?3TF)' 1@6. Vma ro test; Vdo I!1 Vto 10; data tempWI; Vif WI ! 1 Vthen Y,Z0retain var1 var2 var2;1; Velse Vif WI ! 2 Vthen Y,Z0retain var6 var= var9;1; ..more sas statements Vend; Vmend; Liven the sample ode above5 what Beyword is needed at the Y$A.*% ?&'.T:%'Z for this $A.*% to worB, 1. 2. 2. 6. =. VST* VRS.A' VR&%T) VS+$(&T V&'R&%T)

1@=. #hi h of the following statements below is a valid omment format in SAS, 1. (*%. .%$$)'T: put omment here; 2. "J put omment here J" 2. " put omment here " 6. J" put omment here "J =. J put omment here J 1@9. #hi h of the following is true about >:'E statements,

1. #hen more than one >:'E statement has been e;e uted5 a *)T&*' statement tells the SAS system to go to the top of the /ATA step. 2. A >:'E statement is possible only in SR>. 2. The >:'E statement and the destination must be in the same /ATA step. 6. The a tions of a >:'E statement and a L%T% statement are identi al. =. A /ATA step may have an infinite number of >:'E statements. 1@@. (*%. S%*T data!T)ST '%/&(E)+; by KA*1; run; Liven the above sample ode5 what happens to observations in data set T)ST, 1. 2. :f KA*17s value was repeated in T)ST5 then all but one of the observations with that value were removed. :f KA*17s value was repeated in T)ST5 then all the observations with that value were removed5 but only if the rest of the variables had identi al values. :f KA*17s value was repeated in T)ST5 then all the observations with that value were removed. The value of first.KA*1 and last.KA*1 are both eMual to Nero. :f KA*17s value was repeated in T)ST5 then all the by variables are set to missing.

2. 6. =.

1@A. pro format; value ; 0fuNN!.21 1!7one7 2!7two7 2!7three7; #hat is the purpose of the ?&OO option in the sample ode above, 1. 2. :t spe ifies a width of the de imal value 3 in this ase 2 de imal pla es. :t indi ates that if a variable falls within .2 of the value spe ified in the value statement5 the orresponding label is used to print the value. :t prints the label defined in the value if the variable value ontains a .2. :t multiplies the value of the variable times .25 and if the result eMuals the label 0a ertain number as defined in the /ATA step15 then prints the label. :t divides the value of the variable by .25 and if the result eMuals the label 0a ertain number as defined in the /ATA step15 then prints the label.

2. 6.

=.

1@G. #hi h of the following reates a $A.*% variable and assigns it a value, 1. V$A.*%

2. V$)'/ 2. V(&T 6. V>)T =. VE)+/)? 1A0. :n order to a ess a SAS data set in future SAS sessions5 what must be done,

1. The SAS data set must be reated using a one3level SAS name. 2. The SAS data set must be reated using a two3level SAS name. 2. (ermanent SAS data sets are not available in programming. 6. The SAS data set must be reated with the libref of Q#%*EQ atta hed. =. All SAS data sets are available for future use on e they are reated in a /ATA step. 1A1. data ;; do obsnum ! 1 to 10; output; end; run; #hi h /ATA step below will generate a subset of = %-S in data set P, .hoi e 1 data ;; set ;; where _n_ lt 9; run; .hoi e 2 data ;; set ; 0obs!=1; run; .hoi e 2 data ;; set ; obs!=; run; .hoi e 6

data ;; set ; 0where!0obs!=11; run; .hoi e = data ; 0where!0obs!=11; set ;; run; 1A2. /ata Set A /ata Set /ata Set .

0list of /emo rats1

%-S 'A$) S)P 1 )d $ 1 )d

%-S 'A$) AL) 60 1 )d 2 ?ranB 2 Tom

%-S 'A$)

2 ?ranB $ 2 Earen ? 6 Tom $

2 ?ranB 66 2 Earen 20 6 Tom ==

= #anda ?

= #anda 6G

Liven the three sorted data sets A5 -5 and . 0a list of /emo rats1 in the sample printout above5 whi h /ATA step below would produ e a data set ontaining in ea h observation the name5 se;5 and age of only those who are '%T /emo rats, .hoi e 1 data /; set A - .; run; .hoi e 2 data /; merge A 0in !a1 - 0in!b1 .; by name; if a and b and ; run; .hoi e 2 data /;

merge A - . 0in! 1: by name; if !0; run; .hoi e 6 data /; merge A - .; by name; run; .hoi e = data /; merge A 0in!a1 - 0in!b1 .; if a ! 1 and b !1; by name; run; 1A2. :f var1 then salary!7added to in ome7; Assuming that KA*1 is numeri 5 whi h of the following statements is eMuivalent to the sample above, 1. The variable KA*1 is a hara ter variable5 and if it has a non3blanB value5 then assign 7added to in ome7 to salary. :f the variable KA*1 earned is present5 then go to label marBed salary!added to in ome. :f the variable KA*1 is in the program data ve tor5 then assign 7added to in ome7 to salary. Sele t all of the observations where salary is 7added to in ome7. :f the variable KA*1 is not eMual to 7.7 or 05 then salary ! 7added to in ome7.

2. 2. 6. =.

1A6. data ;; infile y; input a b H= ; run; #hen reading in a raw file using an :'(&T statement5 what does 7H=7 do in the sample ode above, 1. 2. :t advan es the pointer to olumn = of the ne;t input line. :t moves the olumn pointer to olumn =.

2. 6. =.

:t moves the pointer = olumns. :t moves the pointer to the line =. :t inputs = lines into one observation.

1A=. :n a (*%. TA-&>AT)5 what table option supplies an integer value that spe ifies the number of print positions allotted to the heading in the row dimension, 1. -%P! 2. ?%*$.FA*! 2. *TS! 6. ((*! =. ?&OO! 1A9. :n a (*%. (*:'T5 is it possible to print only those variables that begin with a ertain value5 su h as all variables that begin with the letter A, 1. +es. To print out only those variables beginning with the letter A5 use A: in the KA* statement of the (*%. (*:'T. 2. 'o. :n order to spe ify what variables to print5 all the variables must be spelled out in their entirety. The only e; eption is for the :'(&T statement. 2. +es. To print out only those variables beginning with the letter A5 use WA in the KA* statement of the (*%. (*:'T. 6. 'o. 'owhere in SAS an you abbreviate a variable5 in luding the :'(&T statement. =. +es. To print out only those variables beginning with the letter A5 use AV in the KA* statement. 1A@. #hi h of the following is true of the %(T:%'S statement in SAS programs, 1. The %(T:%'S statement an only be used at the beginning of a program. 2. The %(T:%'S statement an only be used in a /ATA step. 2. The %(T:%'S statement .A''%T be used within .A*/S data lines. 6. The %(T:%'S statement must be used within a (*%. step. =. %ne %(T:%'S statement .A''%T be overridden by another %(T:%'S statement. 1AA. data test; input 81 ; 41. 82 y 41. 82 N 41.; ards; A-. AAA-A

; pro sort data!test; by ; y N; data test; set test; by ; y N; f; ! first.;; fy ! first.y; fN ! first.N; l; ! last.;; ly ! last.y; lN ! last.N; run; -ased on the above program5 what are the values of the following variables in data set T)ST, A. 1st observation 3 f; ! , -. 1st observation 3 lN ! , .. 2nd observation 3 ly ! , /. 2nd observation 3 lN ! , ). 2rd observation 3 fy ! , 1. A!1 -!1 .!1 /!0 )!1 2. A!1 -!0 .!0 /!1 )!0 2. A!0 -!1 .!1 /!1 )!1 6. A!1 -!1 .!1 /!1 )!0 =. A!1 -!1 .!0 /!1 )!0 1AG. #hi h SAS fun tion below returns the value QT)STQ, 1. S.A' 0QTF:S :S <&ST A T)STQ5 =1 2. >%.AT) 0QTF:S :S <&ST A T)STQ5 =1 2. S&-ST* 0QTF:S :S <&ST A T)STQ5 QT)STQ1 6. :'/)P 0QTF:S :S <&ST A T)STQ5 =1 =. :'/)P 0QTF:S :S <&ST A T)STQ5 QT)STQ1 1G0. This program generates output; pro format; value 4birds 7 7!7missing7 other!7not missing7;

run; data ;; do i!1 to 2; if i!1 then bird!7 7; if i!2 then bird!7 ardinal7; if i!2 then bird!7wren7; end; pro print; pro freM; table bird; format bird 4birds.; run; *eferring to the program above5 what are the values of YAZ through Y)Z in the following output, %utput: %-S : YAZ Y-Z -:*/ Y.Z

-:*/ ?reMuen y (er ent 33333333333333333333333333333 Y/Z 1. 2. 2. 6. =. Y)Z A!1 -!6 .!wren /!not missing )!1 A!1 -!2 .!# /!missing )!1 A!2 -!2 .!blanB /!missing )!1 A!1 -!2 .!wren /!wren )!1 A!1 -!6 .!# /!not missing )!1

1-1" <he ,!ll!win+ is an e7ample !,"""" )=h!!se !ne data empl!5ee; in,ile >empl!5ee"dat>; ?@ Assumin+ direct!r5Abased s5stem @? input id 4$" name 4./" 2B/ l!cale 41/"; run;

A" Cist D" =!lumn =" E!rmatted '" Mi7ed F" 6tandard ans# b 1-." <rue !r Ealse""")=h!!se !ne <he e7tesi!n !, G"sasG is reHuired ,!r sas pr!+ram ,iles" A" <rue D" Ealse Ans# a 1-B" Which !, the ,!ll!win+ are valid statements c!ncernin+ readin+ raw data ,iles usin+ list input# )=h!!se all that appl5 A" <he 'CM= is an !pti!n ,!r the in,ile statement ,!r speci,5in+ delimiters" D" All variables have a de,ault len+th !, 8 b5tes" =" When the input statement runs int! an endA!,Aline marIer* it st!ps readin+ data even th!u+h there are m!re ,ields speci,ied" '" J!u use a 4 a,ter a variable name t! speci,5 a character variable" F" Eields are read ,r!m le,t t! ri+ht" Ans# a*d*e 1-3" Kiven the ,!ll!win+ raw data ,ile* !,,ices"dat* in a direct!r5Abased s5stem* which data step w!uld create a 6A6 data set with !ne !bservati!n ,!r each re+i!n# )=h!!se Lne 11..BB3 1.B35$78-/1.B35$78-/1.B35$78-/1.B35$78-/ Fast Mar5land Merm!nt Maine =entral &llin!is &!wa Nansas Miss!uri West =ali,!rnia Washin+t!n A" data !,,ices; in,ile >!,,ices"dat> st!p!ver; input re+i!n 4 state1Astate3 4; run; D" data !,,ices; in,ile >!,,ices"dat> miss!ver; input re+i!n 4 )state1Astate3 )4 ; run; =" data !,,ices; in,ile >!,,ices"dat> delim=G G; input re+i!n 4 state1 4 state. 4 stateB 4 state3 4; run; '" data !,,ices; in,ile >!,,ices"dat>; input re+i!n 4 state1Astate3 4";

run; F" %!ne !, the ab!ve" Ans# e 1-5" <he d!uble trailin+ G22G in an input statement""")=h!!se all that appl5 A" h!lds the current data line in the bu,,er ,!r an!ther input statement t! pr!cess D" can be used t! read multiple !bservati!ns ,r!m a sin+le data line =" l!ads a new rec!rd int! the input bu,,er i, an endA!,Arec!rd is ,!und in the current rec!rd '" is a s5nta7 err!r" F" %!ne !, the ab!ve" Ans# a* b 1-$" Which 6A6 statement bel!w will chan+e the characteristics !, a variable i, it was used in a data step? A" 6=A% D" A<<R&D =" ELRMA< '" 1(< F" ARRAJ Ans# d 1-7" Which O variable has a value !, 1 at the end !, an input ,ile? A" F%' = O D" LD6 = O =" FLE = O '" CA6<LD6 = O F" %LLD6 = O Ans# a 1-8" Kiven a data ,ile with 1// c!lumns !, data* 5!u !nl5 need t! read in the ,irst 7/ c!lumns" Which !, the ,!ll!win+ c!uld 5!u use# A" in,ile 7 line = 7/; D" in,ile 7 len+th = 71; =" in,ile 7 miss!ver = 7/; '" in,ile 7 ls=7/; F" in,ile 7 linesi8e=7/; 1--" &n the ,!ll!win+ c!de sample# data 758; in,ile abc; input h i :B P; run; What d!es the :B d!? A" &t m!ves the p!inter d!wn B rec!rds D" &t m!ves the c!lumn p!inter t! c!lumn B =" &t adds B t! the value read int! variable i '" &t advances the c!lumn p!inter B places F" &t advances the c!lumn p!inter 3 places Ans# d

.//" What d!es the ,!ll!win+ 6A6 statement d!? i, l!cati!n =# >=>; A" &t selects the !bservati!n i, there is a >=> in the l!cati!n value" D" &t selects the !bservati!n i, there is a >=> at the ,irst p!siti!n in the l!cati!n value" =" &t selects the !bservati!n i, the l!cati!n value is >=>" '" &t selects the !bservati!n i, the l!cati!n value c!ntains a l!wercase >c>" F" %!ne !, the ab!ve* it>s a t5p!" Ans# b

./1" <he ,!ll!win+ pr!+ram is submitted" data test; input name 4 a+e; cards; Q!hn :B5 ;run; Which values are st!red in the !utput data set? A" name a+e Q!hn B5 D" name a+e Q!hn )missin+ value =" name a+e )missin+ value )missin+ value '" <he 'A<A step ,ails e7ecuti!n due t! data err!rs" Ans# a ./."<he ,!ll!win+ !bservati!n is st!red in a 6A6 data set named FM1CLJFF6# C%AMF E%AMF QLD=L'F AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Whitle5 6am na1 &, the 'A<A step bel!w is e7ecuted* what will be the value !, the variable QLD'F6= in the !utput 6A6 data set when this !bservati!n is pr!cessed# data navi+ate; set empl!5ees; i, P!bc!de = >%A1> then P!bdesc = >%avi+at!r>; run; A" navi+at!r D" %avi+at!r =" %AM&KA<LR '" a missin+ value ans# d ./B"<he ,!ll!win+ 6A6 pr!+ram is submitted# pr!c ,!rmat; value sc!re 1 A 5/ = >Eail> 51 A 1// = >1ass>; run;

Which !ne !, the ,!ll!win+ 1R&%< pr!cedure steps c!rrectl5 applies the ,!rmat? A" pr!c print data = sasuser"class; var test; ,!rmat test sc!re; run; D" pr!c print data = sasuser"class; var test; ,!rmat test sc!re"; run; =" pr!c print data = sasuser"class ,!rmat = sc!re; var test; run; '" pr!c print data = sasuser"class ,!rmat = sc!re"; var test; run; Ans# b ./3 Kiven the ,!ll!win+ 'A<A step# data l!!p; 7 = /; d! inde7 = 1 t! 5 b5 .; 7 = inde7 ; end; run; (p!n c!mpleti!n !, e7ecuti!n* what are the values !, the variables O and &%'FO in the 6A6 data set named CLL1? A" 7 = B* inde7 = B D" 7 = B* inde7 = 3 =" 7 = 5* inde7 = 5 '" 7 = 5* inde7 = $ F" 7 = 5* inde7 = 7 Ans# F ./5 Kiven that the data set named L%F c!ntains 1/ !bservati!ns and the data set named <WL c!ntains 1/ !bservati!ns* h!w man5 !bservati!ns will be c!ntained in the data set named =LMD&%F that is created in the ,!ll!win+ 'A<A step? data c!mbine; set !ne tw!; run; A" 1/ D" ./ =" /* the 'A<A step will ,ail due t! s5nta7 err!rs '" 1/ t! ./* dependin+ !n h!w man5 !bservati!ns match ans# b

./$" A ,!rmat statement sh!uld be speci,ied be,!re the =AR'6 statement when we read internal raw data" a" <rue b" Ealse Ans# true ./7" An e7ternal ,ile with a ma7imum rec!rd len+th !, ..5 is read int! 6A6 in a 'A<A step" 6elect all statements that reads the data c!rrectl5" a" &%E&CF R=#Sm5data"dat CRF=C=.///; b" &%E&CF R=#Sm5data"dat CRF=C=..5; c" &%E&CF R=#Sm5data"dat ; ./8" 6elect the Ealse statement ab!ut Cist &nput meth!d !, readin+ data a" Reads data separated b5 several spaces" b" '!es n!t sIip !ver unwanted values in the input data" c" Reads a date" Ans# c ./-" =!lumn &nput st5le can read a character data value with space embeddin+ a" <rue b" Ealse Ans# a .1/" A standard numeric data in 6A6 can c!ntain a RAR )ne+ative si+n and RF ,!r scienti,ic n!tati!ns a" <rue b" Ealse Ans# a .11" A n!n standard data )%umbers with c!mma* dates liIe /BAL=<A.//5 ,!ll!win+ &%1(< st5les )select all c!rrect answers a" E!rmatted &nput b" M!di,ied Cist &nput c" (sin+ &n,!rmats in &%1(< statement .1." Kiven the line !, raw data# 11..BB 6=L'F6 T M % And the data statement# &%1(< 2>6=L'F6> statusc!des #41/"; When e7ecuted in a 'A<A step c!rrectl5* what value the variable R6tatusc!des +ets? a" T b" T M % c" " )Missin+ ans# a can be read with the

.1B" <he ,!ll!win+ statement is submitted# 'ata <est; &%1(< accnum 4 ? ,name 4 lname 4 ; cards; 1...B.3. Q!hn5 6mith 1eter 6mith <h!mas Q!seph ;run; <he !utput dataset will sh!w which !, the ,!ll!win+? a" accnum ,name lname 1...B.3. Q!hn5 6mith b" accnum ,name lname 1...B.3. 1eter 6mith c" %!ne !, the ab!ve ans# b .13" <he ,!ll!win+ statement is submitted# 'ata <est; &%1(< accnum 4 U. ,name 4 lname 4 ; cards; 1...B.3. Q!hn5 6mith 1eter 6mith <h!mas Q!seph ;run; <he !utput dataset will sh!w which !, the ,!ll!win+? a" accnum ,name lname 1...B.3. Q!hn5 6mith b" accnum ,name lname 1...B.3. 1eter 6mith c" %!ne !, the ab!ve ans# b .15" <he ,!ll!win+ &%1(< statements are submitted# 'ata <est; &%1(< accnum 4 ,name 4 lname 4 22 ; cards; 1...B. Q!hn5 6mith 1B.B3B 1eter 6mith 13.3B3 <h!mas Q!seph; run; Which !, the ,!ll!win+ statement is c!rrect? a" Lutput rec!rd set will have !nl5 !ne rec!rd b" Lutput rec!rd set will have B rec!rds c" 'ata step inc!mplete due t! inc!rrect s5nta7 ans# b

.1$" 'ata,ile Rc#Sm5data"dat c!ntains acc!unt number* ,irst name and last name !, acc!unt h!lders with ,!ll!win+ structure" 1...B. Q!hn5 6mith 13.3B3 <h!mas 15.5B5 'an 1aul Which statement bel!w reads the data c!rrectl5 int! 6A6" a" 'ata <est; &%E&CF >c#Sm5data"dat> M&66LMFR; &%1(< accnum 4 1A$ ,name 4 8A13 lname 4 1$A./; run; b" 'ata <est; &%E&CF >c#Sm5data"dat> <R(%=LMFR; &%1(< accnum 4 1A$ ,name 4 8A13 lname 4 1$A./; run; c" 'ata <est; &%E&CF >c#Sm5data"dat> miss!ver; &%1(< accnum 4 ,name 4 lname 4; run; .17" <he ,!ll!win+ statement is submitted 'ata <est; &%E&CF >c#Sm5data"dat; &%1(< client0id 4 1AB 2; &E client0id >Q=1> then delete; &%1(< accnum 4 3A8 ,name 4 -A13 lname 4 1$A./; run; V!w man5 c!lumns will be there in dataset R<est ? a" %!ne b" B c" 3 ans# ma5 be a .18" An e7ternal data ,ile has acc!unt !pen date in the ,!ll!win+ ,!rmat " /1A1BA-5 /1A13A-$ /1A15A-7 Which !, the ,!ll!win+ is a c!rrect &%1(< statement in 'A<A step t! read this data" a" &%1(< Acc!unt0n! mmdd558" ; b" &%1(< Acc!unt0n! mmdd55$" ; c" &%1(< Acc!unt0n! ddmm558" ; ans# a

.1-" <he ,!ll!win+ statements are submitted 'ata <est; t!da5 = >./dec.//5>d; ,!rmat t!da5 mmdd551/"; run; Which !, the ,!ll!win+ statement is true ? a" R<!da5 variable displa5s liIe R1.?./?.//5 b" 'ata step n!t e7ecuted due t! wr!n+ ,!rmat Rmmdd55" c" <!da5 is displa5ed as R./'F=.//5 ans# a ../" E!ll!win+ statements are submitted# pr!c e7p!rt data = Acc!unt0per, !ut,ile = >d#Ste7t1"csv>; run; pr!c e7p!rt data = Acc!unt0per, !ut,ile = >d#Ste7t."csv> 'DM6 ='CM RF1CA=F; 'FC&M&<FR =>*>; run; 6elect all ,alse statements# a" <here are tw! ,iles * te7t1"csv and te7t."csv * created in d#S b" D!th te7t1 and te7t. ,iles have the same data values delimited b5 a c!mma c" <e7t1 data ,ile will have a spaceAdelimited data as a standard 6A6 !utput" d" Lnl5 te7t."csv is created with values delimited b5 a c!mma" Ans# ma5 be d %!te# the pr!+rams in the e7ample e e7pects n! err!rs due t! impr!per use !, ;* R* etc"

..1" Eile =#Sm5data"dat c!ntains 1// c!mplete rec!rds and the ,!ll!win+ pr!+ram is submitted" !pti!ns !bs=1/; 'ata <est; &%E&CF >c#Sm5data"dat> ,irst!bs=B; &%1(< accnum 4 ,name 4 lname 4; run; Which !, the ,!ll!win+ statement is c!rrect? a" <est data set will have -8 r!ws b" <est dataset will have ,irst 1/ !bservati!ns c" <est dataset will have 1/ !bservati!ns read startin+ ,r!m third data line in m5data"dat d" <est dataset will have 8 !bservati!ns read startin+ ,r!m third data line in m5data"dat Ans# ma5 be d ..." <he ,!ll!win+ pr!+ram is submitted t! read a delimited ,ile

'ata <est; &%E&CF >c#Sm5data"dat> 'CM=>4> '6' ; &%1(< accnum 4 ,name 4 lname 4; run; What R'6' Ie5w!rd d!es here? )6elect all c!rrect answers a" &t d!es n!t treat R4 character as part !, the data value and treat it as delimiter" b" &t rec!+ni8e tw! c!nsecutive R4 characters as a missin+ value ,!r the variable read c" &, data value is speci,ied in Hu!tes with embedded R4 character '6' !pti!n treats it as part !, the data" Ans# b ..B" A 1RL= 'A<A<6F<6 is used as ,!ll!ws)assumpti!n# all libraries are and datasets are e7istin+ # pr!c datasets librar5=m5lib details; c!p5 !ut=rl!c; select sc!redata; delete tensi!n ; run; Which statement bel!w e7plains the !perati!ns ab!ve m!st c!rrectl5? a" &t lists all 6A6 data ,iles with ,ile si8e and date m!di,ied in Rm5lib librar5 and maIes a c!p5 !, Rsc!redata ,ile in Rrl!c librar5 and deletes Rtensi!n dataset"" b" &t lists all 6A6 data ,iles with ,ile si8e and date m!di,ied in Rm5lib librar5 and deletes Rtensi!n ,ile ,r!m Rrl!c librar5" c" &t lists all 6A6 data ,iles with ,ile si8e and date m!di,ied in Rm5lib librar5 and maIes a c!p5 !, Rsc!redata ,ile in Rrl!c librar5 and als! c!pies the Rsc!redata ,ile in Rrl!c librar5" d" &t lists all sas data ,iles with ,ile si8e and date m!di,ied in Rm5lib librar5 and maIes a c!p5 !, Rsc!redata ,ile in Rrl!c librar5" ..3" <he ,!ll!win+ pr!+ram is submitted" Which is a ,alse statement ab!ut the !utput !, this pr!+ram? pr!c c!ntents data=sc!redata; run; a" 1rints U !, !bservati!ns in Rsc!redata b" 1rints a snapsh!t !, the data int! the screen" c" 1rints the date Rsc!redata was created d" Cists all labels ass!ciated with variables in Rsc!redata

..5" <he ,!ll!win+ line !, c!de is used in a 6A6 data step " 'ata 77; 6et 55; attrib status0c!des len+th=43 label =>6tatus =!des> ,!rmat =4upcase8"; run; &, 55 has a variable names status0c!des and the user wants the attributes t! be chan+ed in 77 " Will this statement chan+e the len+th* label and ,!rmat in 77 dataset?

a" JF6 b" %L c" %! 6u,,icient &n,!rmati!n

..$" <he bel!w three pr!+ram bl!cIs are submitted A 'ata tar+et0data ; 6et base0data))Ieep = var1 var. varB ; Run; D 'ata tar+et0data ; 6et base0data; Ieep = var1 var. varB ; Run; = 'ata tar+et0data )Ieep = var1 var. varB ; 6et base0data; Run; &, the user needs !nl5 var1* var. and varB t! w!rI with* which step is m!st e,,icient? a" A b" D c" = d" AWD e" %!ne ans# a

..7" <he ,!ll!win+ pr!+ram is submitted )Assumpti!n is !s0d!llars is an e7istin+ dataset with client +r!ups )client0+r!up and d!llar !utstandin+ )!s ,ields" " 'ata test; 6F< !s0d!llars F%'=E&% ; DJ client0+r!up; t0!s :!s; &E CA6<"clinet0+r!up <VF% 'L ; +0!s :t0!s ; t0!s=/;F%';run; What this pr!+ram d!es? a" =!mputes the +r!ss !utstandin+ acr!ss the +r!ups and st!re it in +0!s variable* last r!w" b" =!mputes the !ustandin+s ,!r client +r!ups and retain them in t0!s variable c" %!ne !, the ab!ve"

..8" <he ,!ll!win+ pr!+ram was submitted t! 6A6 data temp; len+th m50number 4 3;

input m50number; cards; 1.B3 ///;run; data new)dr!p=7 ; set temp)rename=)m50number=7 ; m50number=input)7*best3" ;run; pr!c print data=new;run; Whats the !utput w!uld be? A Lbs m50number 1 1.B3 . D Lbs m50number 1 1.B3 . ///= Lbs m50number " " Ans# A ..-" <he ,!ll!win+ pr!+ram is submitted# 7=>./Pan-3>d; 5=Htr)7 ; put 5=; What value w!uld be printed t! the 6A6 l!+? a" 1 b" . c" B d" %!ne ans# a .B/" <he ,!ll!win+ pr!+ram submitted# data 77; date1=1..5-1; date.=put)date1*8$" ;run; Whats the data t5pe !, date1 and date . ? a" 'ate1 =haracter* 'ate . %umeric b" 'ate1 numeric* 'ate . character c" 65nta7 err!r* n!t e7ecuted Ans# b .B1" <he ,!ll!win+ statement ,!rms a part !, 6A6 dataset )n! s5nta7 err!rs

'ata 77; 6et 55; arra5 wei+ht wt1Awt5/; d! i=1 t! 5/; i, wei+htXiY=--- then wei+htXiY=missin+; end; run; 6elect all c!rrect statements bel!w# a" =reates a variable wei+ht and assi+ns w1Awt5/ )wt1* wt.* wtB etc b" Mariables named wt1Awt5/ e7ist in the 55 data set" c" &, an5 !, the ,ields in wt1Awt5/ have a value !, R--- then it will be reset with a Rmissin+ " d" Fvaluated all 5/ ,ields and the entire table l!!Iin+ ,!r value R--- in an5 !, the ,ields ans# b*c .B." <he ,!ll!win+ pr!+ram is submitted# pr!c rep!rt data =77 n!wind!ws headline headsIip ; <itle >6ummar5 acr!ss +r!ups; c!lumn s0+ % )!s c! * MFA% ; de,ine s0+ ?+r!up; run; Whats the !bPective !, usin+ MFA%? a" =!mpute mean )Avera+e !, variables L6 and =L b" =!mpute mean and %)c!unt !, s0+ and MFA% !, L6 and =L c" =!mpute mean and %)c!unt !, s0+ and MFA% !, L6 and =L b5 s0+ +r!ups"

233. How many observations and variables does the data set below contain? Name Picker Fletcher Romano Choi a. b. c. d. F M Sex M Age 32 28 . 42

3 observations, 4 variables 3 observations, 3 variables 4 observations, 3 variables can't tell beca se some val es are missing

234. How many !rogram ste!s are exec ted when the !rogram below is !rocessed? data user.tables; infile jobs; input date name $ job $; run; proc sort data=user.tables; by name; run; proc print data=user.tables; run; a. b. c. d. three "o r "ive six

23#. $hat ty!e o" variable is the variable AcctN m in the data set below? AcctN m 3456_1 2451_2 Romano Choi a. b. c. d. F M n meric character can be either character or n meric can't tell "rom the data shown %alance M

23&. $hat ty!e o" variable is the variable $ear in the data set below? %rand Acme Ajax Atlas A. %. '. (. $ear 43 34 . n meric character can be either character or n meric can't tell "rom the data shown

23). $hich o" the "ollowing variable names is valid? a. 4%irth(ate b. *'ost c. +,tems+ d. -ax./ate

230. $hich o" the "ollowing "iles is a !ermanent SAS "ile? a. Sashel .Pr!Sale b. Sas"ser.M#Sales c. Pro$its.%"arter1 d. all o" the above 231. ,n a (A-A ste!, how can yo re"erence a tem!orary SAS data set named 2orecast? a. Forecast b. &ork.Forecast c. Sales.Forecast 3a"ter assigning the libre" Sales4 d. only a and b above 245. $hat is the de"a lt length "or the n meric variable %alance? Name Adams 7eller 8artine9 Noble a. b. c. d. # & ) 0 %alance 65#.)3 65).01 1).4# 602.#5

246. How many statements does the "ollowing SAS !rogram contain? proc print data=new.prodsale label double; var state day price1 price2; where state='NC'; label state='Name of run; a. b. c. d. three "o r "ive six tate';

242. $hat is a SAS data library? a. a collection o" SAS "iles, s ch as SAS data sets and catalogs b. in some o!erating environments, a !hysical collection o" SAS "iles c. in some o!erating environments, a logically related collection o" SAS "iles d. all o" the above

243. ," yo s bmit the "ollowing !rogram, how does the o t! t loo:? o!tions !agesi9e;## non mber< !roc tab late data;clinic.admit< class actlevel< var age height weight< table actlevel,3age height weight4=mean< r n< o!tions linesi9e;05< !roc means data;clinic.heart min max maxdec;6< var arterial heart cardiac rinary< class s rvive sex< r n< a. b. c. d. -he >/?' 8@ANS o t! t has a !rint line width o" 05 characters, b t the >/?' -A%ABA-@ o t! t has no !rint line width. -he >/?' -A%ABA-@ o t! t has no !age n mbers, b t the >/?' 8@ANS o t! t has !age n mbers. @ach !age o" o t! t "rom both >/?' ste!s is ## lines long and has no !age n mbers, and the >/?' 8@ANS o t! t has a !rint line width o" 05 characters. -he date does not a!!ear on o t! t "rom either >/?' ste!.

244. ,n order "or the date val es 5#8ay61## and 548ar254& to be read correctly, what val e m st the C@A/'A-?22; o!tion have? a. a val e between 614) and 61#4, incl sive b. 61## or higher c. 614& or higher d. any val e 24#. $hen yo s!eci"y an engine "or a library, yo are always s!eci"ying a. the "ile "ormat "or "iles that are stored in the library. b. the version o" SAS that yo are sing. c. access to other so"tware vendors' "iles. d. instr ctions "or creating tem!orary SAS "iles. 24&. $hich statement !rints a s mmary o" all the "iles stored in the library named Area#6? a. !roc contents data;area#6.+all+ nods< b. !roc contents data;area#6 +all+ nods< c. !roc contents data;area#6 +all+ noobs< d. !roc contents data;area#6 +all+.nods<

24). -he "ollowing >/?' >/,N- o t! t was created immediately a"ter >/?' -A%ABA-@ o t! t. $hich SAS system o!tions were s!eci"ied when the re!ort was created? 6 65D53 2riday, 8arch 6), 2555

Act ?bs ,( Height $eight Bevel 2ee

6 24#0 )2 2 24&2 && 3 2#56 &6 4 2#23 &3 # 2#31 )6 & 2#44 )& ) 2##2 &) 0 2### )5 1 2#&3 a. b. c. d.

6&0 H,7H 0#.25 6#2 H,7H 624.05 623 B?$ 641.)# 63) 8?( 641.)# 6#0 B?$ 624.05 613 H,7H 624.05 6#6 8?( 641.)# 6)3 8?( 641.)#

)3 6#4 B?$ 624.05 ?%S;, (A-@, and N?NA8%@/ >A7@N?;6 and (A-@ NA8%@/ and (A-@ only none o" the above

240. $hich o" the "ollowing !rograms correctly re"erences a SAS data set named SalesAnalysis that is stored in a !ermanent SAS library? a. b. c. d. e. ". g. h. i. G. :. data saleslibrary.salesanalysis< set mydata.E arter6sales< i" salesF655555< r n< data mysales.totals< set sales+11.salesanalysis< i" totalsalesF#5555< r n< !roc !rint data;salesanalysis.E arter6< var sales salesre! month< r n<

l. m. n.

!roc "reE data;6111data.salesanalysis< tables E arter=sales< r n<

241. $hich time s!an is sed to inter!ret two.digit year val es i" the C@A/'A-?22; o!tion is set to 61#5? a. 61#5.2541 b. 61#5.25#5 c. 6141.25#5 d. 61#5.2555 2#5. Ass ming yo are sing SAS code and not s!ecial SAS windows, which one o" the "ollowing statements is "alse? a. B,%NA8@ statements can be stored with a SAS !rogram to re"erence the SAS library a tomatically when yo s bmit the !rogram. b. $hen yo delete a libre", SAS no longer has access to the "iles in the library. However, the contents o" the library still exist on yo r o!erating system. c. Bibre"s can last "rom one SAS session to another. d. Co can access "iles that were created with other vendors' so"tware by s bmitting a B,%NA8@ statement. 2#6. $hat does the "ollowing statement do? libname osiris s!ss 'cDHmy"ilesHsasdataHdata'< a. de"ines a library called S!ss sing the ?S,/,S engine b. de"ines a library called ?siris sing the S>SS engine c. de"ines two libraries called ?siris and S!ss sing the de"a lt engine d. de"ines the de"a lt library sing the ?S,/,S and S>SS engines 2#2. $hat does the "ollowing ?>-,?NS statement do? o!tions !agesi9e;6# nodate< a. s !!resses the date and limits the !age si9e o" the log b. s !!resses the date and limits the vertical !age si9e "or text o t! t c. s !!resses the date and limits the vertical !age si9e "or text and H-8B o t! t d. s !!resses the date and limits the hori9ontal !age si9e "or text o t! t

2#3. As yo write and edit SAS !rograms, itIs a good idea to a. begin (A-A and >/?' ste!s in col mn one. b. indent statements within a ste!. c. begin /AN statements in col mn one. d. all o" the above. 2#4. $hat s ally ha!!ens when a syntax error is detected? a. SAS contin es !rocessing the ste!. b. SAS contin es to !rocess the ste!, and the SAS log dis!lays messages abo t the error. c. SAS sto!s !rocessing the ste! in which the error occ rred, and the SAS log dis!lays messages abo t the error. d. SAS sto!s !rocessing the ste! in which the error occ rred, and the ? t! t window dis!lays messages abo t the error. 2##. A syntax error occ rs when a. some data val es are not a!!ro!riate "or the SAS statements that are s!eci"ied in a !rogram. b. the "orm o" the elements in a SAS statement is correct, b t the elements are not valid "or that sage. c. !rogram statements do not con"orm to the r les o" the SAS lang age. d. none o" the above. 2#&. How can yo tell whether yo have s!eci"ied an invalid o!tion in a SAS !rogram? a. A log message indicates an error in a statement that seems to be valid. b. A log message indicates that an o!tion is not valid or not recogni9ed. c. -he message J>/?' r nningJ or J(A-A ste! r nningJ a!!ears at the to! o" the active window. d. Co can't tell ntil yo view the o t! t "rom the !rogram. 2#). $hich o" the "ollowing !rograms contain a syntax error? a. b. c. d. e. ". g. h. i. G. !roc sort data;sas ser.mysales< by region< r n< dat sas ser.mysales< set mydata.sales11< r n< !roc !rint data;sas ser.mysales label< label region;'Sales /egion'< r n< none o" the above.

2#0. $hat does the "ollowing log indicate abo t yo r !rogram?

!roc !rint data;sas ser.cargo11 var origin dest cargorev< 22 )& @//?/ 22.322D Syntax error, ex!ecting one o" the "ollowingD <, 3, (A-A, (?A%B@, H@A(,N7, BA%@B, N, N??%S, ?%S, /?AN(, /?$S, S>B,-, S-CB@, AN,2?/8, $,(-H. @//?/ )&.322D Syntax error, statement will be ignored. 66 r n<

a. b. c. d.

SAS identi"ies a syntax error at the !osition o" the KA/ statement. SAS is reading KA/ as an o!tion in the >/?' >/,N- statement. SAS has sto!!ed !rocessing the !rogram beca se o" errors. all o" the above

2#1. $hich >/?' >/,N- ste! below creates the "ollowing o t! t? (ate 548A/11 5#8A/11 5&8A/11 5)8A/11 508A/11 518A/11 658A/11 a. b. c. d. e. ". ?n 232 160 163 241 183 211 167 'hanged 18 4 14 9 11 18 7 2light 219 219 219 219 219 219 219

roc !rint data;"lights.lag ardia noobs< var on changed "light< where onF;6&5< r n< !roc !rint data;"lights.lag ardia< var date on changed "light<

g. h. i. G. :. l. m. n. o. !. E. r. s.

where changedF3< r n< !roc !rint data;"lights.lag ardia label< id date< var boarded trans"erred "light< label boarded;'?n' trans"erred;''hanged'< where "light;'261'< r n< !roc !rint "lights.lag ardia noobs< id date< var date on changed "light< where "light;'261'< r n<

2&5. $hich o" the "ollowing >/?' >/,N- ste!s is correct i" labels are not stored with the data set? a. b. c. d. e. ". g. h. i. !roc !rint data;allsales.totals label< label region0;'/egion 0 Cearly -otals'< r n< !roc !rint data;allsales.totals< label region0;'/egion 0 Cearly -otals'< r n< !roc !rint data allsales.totals label noobs< r n< !roc !rint allsales.totals label< r n<

2&6. $hich o" the "ollowing statements selects "rom a data set only those observations "or which the val e o" the variable Style is /AN'H, S>B,-, or -$?S-?/C? a. where style;'/AN'H' or 'S>B,-' or '-$?S-?/C'< b. where style in '/AN'H' or 'S>B,-' or '-$?S-?/C'< c. where style in 3/AN'H, S>B,-, -$?S-?/C4< d. where style in 3'/AN'H','S>B,-','-$?S-?/C'4< 2&2. ," yo want to sort yo r data and create a tem!orary data set named 'alc to store the sorted data, which o" the "ollowing ste!s sho ld yo s bmit? a. b. c. d. e. ". g. h. i. G. :. !roc sort data;wor:.calc o t;"inance.dividend< r n< !roc sort dividend o t;calc< by acco nt< r n< !roc sort data;"inance.dividend o t;wor:.calc< by acco nt< r n< !roc sort "rom "inance.dividend to calc< by acco nt< r n<

2&3. $hich o!tions are sed to create the "ollowing >/?' >/,N- o t! t?

63D2) 8onday, 8arch 22, 6111

>atient

Arterial

Heart

'ardiac

Arinary

253

00

1#

&&

665

#4

03

603

1#

&&4

)2

666

332

62

265

)4

1)

3&1

656

05

635

216

a. b. c. d.

the (A-@ system o!tion and the BA%@B o!tion in >/?' >/,Nthe (A-@ and N?NA8%@/ system o!tions and the (?A%B@ and N??%S o!tions in >/?' >/,Nthe (A-@ and N?NA8%@/ system o!tions and the (?A%B@ o!tion in >/?' >/,Nthe (A-@ and N?NA8%@/ system o!tions and the N??%S o!tion in >/?' >/,N-

2&4. $hich o" the "ollowing statements can yo 8onth 01 02 03 04 05 ,nstr ctors 1 2 1 1 3 0 a. b. c. d. e. ". g. var month instr ctors< Aer'lass 37 41 52 61 49 245

se in a >/?' >/,N- ste! to create this o t! t? $al:Log/ n 91 102 98 118 88 41) Swim 83 27 19 22 29 605

s m instr ctors aerclass wal:Gogr n swim< var month< s m instr ctors aerclass wal:Gogr n swim< var month instr ctors aerclass< s m instr ctors aerclass wal:Gogr n swim< all o" the above

2&#. $hat ha!!ens i" yo s bmit the "ollowing !rogram? !roc sort data;clinic.diabetes< r n< !roc !rint data;clinic.diabetes< var age height weight ! lse< where sex;'2'< r n< a. b. c. d. -he >/?' >/,N- ste! r ns s ccess" lly, !rinting observations in their sorted order. -he >/?' S?/- ste! !ermanently sorts the in! t data set. -he >/?' S?/- ste! generates errors and sto!s !rocessing, b t the >/?' >/,N- ste! r ns s ccess" lly, !rinting observations in their original 3 nsorted4 order. -he >/?' S?/- ste! r ns s ccess" lly, b t the >/?' >/,N- ste! generates errors and sto!s !rocessing.

2&&. ," yo s bmit the "ollowing !rogram, which o t! t does it create? !roc sort data;"inance.loans o t;wor:.loans< by months amo nt< r n< !roc !rint data;wor:.loans noobs< var months< s m amo nt !ayment< where monthsM3&5< r n< a. 8onths 12 24 36 48 Amo nt $3,500 $8,700 $10,000 $5,000 *2),255 b. 8onths 12 24 36 48 Amo nt $3,500 $8,700 $10,000 $5,000 2),255 c. 8onths 12 48 24 36 Amo nt $3,500 $5,000 $8,700 $10,000 *2),255 d. >ayment $308.52 $128.02 $403.47 $325.02 *6,6&#.53 >ayment $308.52 $403.47 $325.02 $128.02 6,6&#.53 >ayment $308.52 $403.47 $325.02 $128.02 *6,6&#.53

8onths 12 24 36 48

Amo nt $3,500 $8,700 $10,000 $5,000

>ayment $308.52 $403.47 $325.02 $128.02 *6,6&#.53

e. 2&). 'hoose the statement below that selects rows in which the amo nt is less than or eE al to *#555 the acco nt is 656N6512, or the rate eE als 5.51#. a. b. c. d. e. ". g. h. where amo nt M; #555 and acco nt;'656.6512' or rate ; 5.51#< where 3amo nt le #555 and acco nt;'656.6512'4 or rate ; 5.51#< where amo nt M; #555 and 3acco nt;'656.6512' or rate eE 5.51#4< where amo nt M; #555 or acco nt;'656.6512' and rate ; 5.51#<

2&0. $hat does >/?' >/,N- dis!lay by de"a lt? a. >/?' >/,N- does not create a de"a lt re!ort< yo m st s!eci"y the rows and col mns to be dis!layed. b. >/?' >/,N- dis!lays all observations and variables in the data set. ," yo want an additional col mn "or observation n mbers, yo can reE est it. c. >/?' >/,N- dis!lays col mns in the "ollowing orderD a col mn "or observation n mbers, all character variables, and all n meric variables. d. >/?' >/,N- dis!lays all observations and variables in the data set, a col mn "or observation n mbers on the "ar le"t, and variables in the order in which they occ r in the data set. 2&1. $hich SAS statement associates the "ilere" 'rime with the raw data "ile 'DHStatesH(ataH'rime? a. "ilename crime 'cDHstatesHdataHcrime'< b. "ilename crime cDHstatesHdataHcrime< c. "ilere" crime 'cDHstatesHdataHcrime'< d. "ilename 'cDHstatesHdataHcrime' crime< 2)5. 2ilere"s remain in e""ect ntil a. yo change them. b. yo cancel them. c. yo end yo r SAS session. d. all o" the above 2)6. $hich statement identi"ies the name o" a raw data "ile to be read with the "ilere" >rod cts and s!eci"ies that the (A-A ste! read only records 6N6#? a. in"ile !rod cts obs 6#< b. in"ile !rod cts obs;6#< c. in! t !rod cts obs;6#< d. in! t !rod cts 6.6#<

2)2. $hich o" the "ollowing !rograms correctly writes the observations "rom the data set below to a raw data "ile? SAS Data Set Work.Patients ,( 2354 6620 442# 630) 1562 &362 #430 3)00 162# 3430 a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. . v. w. x. y. r n< data +n ll+< set wor:.!atients< "ile 'cDHclinicH!atientsHre"errals.dat'< ! t id 6.4 sex & age 0.1 height 66.62 weight 64.6& ! lse 60.25< r n< data +n ll+< set wor:.!atients< "ile cDHclinicH!atientsHre"errals.dat< ! t id 6.4 sex & age 0.1 height 66.62 weight 64.6& ! lse 60.25< r n< data re"errals.dat< set wor:.!atients< in! t id 6.4 sex & age 0.1 height 66.62 weight 64.6& ! lse 60.25< Sex 2 8 2 2 2 8 2 8 2 8 data +n ll+< set wor:.!atients< in"ile 'cDHclinicH!atientsHre"errals.dat'< in! t id 6.4 sex & age 0.1 height 66.62 weight 64.6& ! lse 60.25< Age 6& 43 40 #) 31 #2 42 30 #& 6# Height &6 )6 && &4 &3 )2 &2 )3 &4 && $eight 652 260 6&2 642 6#) 245 6&0 234 6#1 645 > lse 655 )& 05 )5 &0 )) 03 )6 )5 &)

9.

r n<

2)3. $hich raw data "ile can be read sing col mn in! t? a.

b.

c.

d.

all o" the above

2)4. $hich !rogram creates the o t! t shown below?

?bs 6 2 3 4 a. b. c. d. e. ". g.

,( 342) 643& 2062 6&#3

BastName 'hen (avis Oing Sanche9

2irstName Steve Bee Kic:y Lac:

'ity /aleigh Atlanta 8em!his Atlanta

data wor:.salesre!< in"ile em!data< in! t ,( * 6.4 BastName * &.62 2irstName * 64.60 'ity * 25.21< r n< !roc !rint data;wor:.salesre!< r n<

h. i. G. :. l. m. n. o. !. E. r. s. t. . v.

data wor:.salesre!< in"ile em!data< in! t ,( * 6.4 Name * &.62 2irstName * 64.60 'ity * 25.21< r n< !roc !rint data;wor:.salesre!< r n< data wor:.salesre!< in"ile em!data< in! t ,( * 6.4 name6 * &.62 name2 * 64.60 'ity * 25.21< r n< !roc !rint data;wor:.salesre!< r n< all o" the above

2)#. $hich statement correctly reads the "ields in the "ollowing orderD Stoc:N mber, >rice, ,tem, 2inish, Style? 2ield Name Start 'ol mn @nd 'ol mn (ata -y!e Stoc:N mber 2inish Style ,tem >rice # 66 25 2) 6 1 60 24 32 3 character

character character character n meric

a. b. c. d. e. ". g. h.

in! t Stoc:N mber * 6.3 2inish * #.1 Style * 66.60 ,tem * 25.24 >rice 2).32< in! t Stoc:N mber * 6.3 >rice 2).32 ,tem * 25.24 2inish * #.1 Style * 66.60< in! t * Stoc:N mber 6.3 >rice 2).32 * ,tem 25.24 * 2inish #.1 * Style 66.60< in! t Stoc:N mber * 6.3 >rice * 2).32 ,tem * 25.24 2inish * #.1 Style * 66.60<

2)&. $hich statement correctly re.de"ines the val es o" the variable ,ncome as 655 !ercent higher? a. income;income=6.55< b. income;incomeP3income=2.554< c. income;income=2< d. income; =2< 2)). $hich !rogram correctly reads instream data? a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. . v. w. x. y. 9. aa. bb. cc. dd. ee. "". gg. hh. ii. GG. data "inance.newloan< in! t datalines< i" co ntry;'LA>AN'< 8onthAvg;amo ntQ62< 6110 AS 6110 AS 'A/S 614324.62 -/A'OS 642215.35 65403.44 22#55.#) 6#5&&.43

6110 'ANA(A 'A/S 6110 8@R,'? 'A/S 6110 LA>AN 'A/S < data "inance.newloan<

6110 'ANA(A -/A'OS 13#43.&4 6110 8@R,'? -/A'OS 65510.00 6110 LA>AN -/A'OS 45)55.34

in! t Cear 6.4 'o ntry * &.66 Kehicle * 63.60 Amo nt 25.20< i" co ntry;'LA>AN'< 8onthAvg;amo ntQ62< datalines< r n< data "inance.newloan< in! t Cear 6.4 'o ntry &.66 Kehicle 63.60 Amo nt 25.20< i" co ntry;'LA>AN'< 8onthAvg;amo ntQ62< datalines< 6110 AS 6110 AS 'A/S 614324.62 -/A'OS 642215.35 65403.44 22#55.#) 6#5&&.43

6110 'ANA(A 'A/S 6110 8@R,'? 'A/S 6110 LA>AN 'A/S < data "inance.newloan<

6110 'ANA(A -/A'OS 13#43.&4 6110 8@R,'? -/A'OS 65510.00 6110 LA>AN -/A'OS 45)55.34

::. ll. mm. nn. oo. !!. EE. rr. ss. tt. . vv. xx.

in! t Cear 6.4 'o ntry * &.66 Kehicle * 63.60 Amo nt 25.20< i" co ntry;'LA>AN'< 8onthAvg;amo ntQ62< datalines< 6110 AS 6110 AS 'A/S 614324.62 -/A'OS 642215.35 65403.44 22#55.#) 6#5&&.43

6110 'ANA(A 'A/S 6110 8@R,'? 'A/S 6110 LA>AN 'A/S <

6110 'ANA(A -/A'OS 13#43.&4 6110 8@R,'? -/A'OS 65510.00

ww. 6110 LA>AN -/A'OS 45)55.34

2)0. $hich SAS statement s bsets the raw data shown below so that only the observations in which Sex 3in the second "ield4 has a val e o" 2 are !rocessed?

a. b. c. d.

i" sex;"< i" sex;2< i" sex;'2'< a or b

2)1. $hich o" the "ollowing is not created d ring the com!ilation !hase? a. the data set descri!tor b. the "irst observation c. the !rogram data vector d. the +N+ and +@//?/+ a tomatic variables 205. ( ring the com!ilation !hase, SAS scans each statement in the (A-A ste!, loo:ing "or syntax errors. $hich o" the "ollowing is not considered a syntax error? a. incorrect val es and "ormats b. invalid o!tions or variable names c. missing or invalid ! nct ation d. missing or miss!elled :eywords

206. Anless otherwise directed, the (A-A ste! exec tes a. once "or each com!ilation !hase. b. once "or each (A-A ste! statement. c. once "or each record in the in! t "ile. d. once "or each variable in the in! t "ile. 202. At the beginning o" the exec tion !hase, the val e o" +N+ is 6, the val e o" +@//?/+ is 5, and the val es o" the remaining variables are set to a. 5 b. 6 c. nde"ined d. missing 203. S !!ose yo r n a !rogram that ca ses three (A-A ste! errors. $hat is the val e o" the a tomatic variable +@//?/+ when the observation that contains the third error is !rocessed? a. 5 b. 6 c. 2 d. 3 204. $hich o" the "ollowing actions occ rs at the end o" the (A-A ste!? a. -he a tomatic variables +N+ and +@//?/+ are incremented by one. b. -he (A-A ste! sto!s exec tion. c. -he descri!tor !ortion o" the data set is written. d. -he val es o" variables created in !rogramming statements are re.set to missing in the !rogram data vector. 20#. Boo: care" lly at the (A-A ste! shown below. %ased on the ,N>A- statement, in what order will the variables be stored in the new data set? data !erm. !date< in"ile invent< in! t ,(n m * 6#.61 ,tem * 6.63 ,nstoc: 26.22 %ac:?rd 24.2#< -otal;instoc:Pbac:ord< r n<

a. b. c. d.

,(n m ,tem ,nStoc: %ac:?rd -otal ,tem ,(n m ,nStoc: %ac:?rd -otal -otal ,(n m ,tem ,nStoc: %ac:?rd -otal ,tem ,(n m ,nStoc: %ac:?rd

20&. ," SAS cannot inter!ret syntax errors, then a. data set variables will contain missing val es. b. the (A-A ste! does not com!ile. c. the (A-A ste! still com!iles, b t it does not exec te. d. the (A-A ste! still com!iles and exec tes.

20). $hat is wrong with this !rogram? data !erm. !date< in"ile invent in! t ,tem * 6.63 ,(n m * 6#.61 ,nstoc: 26.22 %ac:?rd 24.2#< total;instoc:Pbac:ord< r n< a. b. c. d. missing semicolon on second line missing semicolon on third line incorrect order o" variables incorrect variable ty!e

200. Boo: care" lly at this section o" a SAS session log. %ased on the note, what was the most li:ely !roblem with the (A-A ste!?

N?-@D ,nvalid data "or ,(n m in line ) 6#.61. /AB@D ....P....6....P....2....P....3....P....4 ) %ird 2eeder B7500 3 25

,tem;%ird 2eeder ,(n m;. ,nStoc:;3 %ac:?rd;25 -otal;23 +@//?/+;6 +N+;6

a. b. c. d.

A :eyword was miss!elled in the (A-A ste!. A semicolon was missing "rom the ,N2,B@ statement. A variable was miss!elled in the ,N>A- statement. A dollar sign was missing in the ,N>A- statement.

201. ," yo don't s!eci"y the B,%/A/C; o!tion, yo r "ormats are stored in $or:.2ormats, and they exist 6. only "or the c rrent !roced re. 2. only "or the c rrent (A-A ste!. 3. only "or the c rrent SAS session. 4. !ermanently. 215. $hich o" the "ollowing statements will store yo r "ormats in a !ermanent catalog? 6. libname library 'cDHsasH"ormatsHlib'<!roc "ormat lib;library ...< 2. libname library 'cDHsasH"ormatsHlib'<"ormat lib;library ...< 3. library;'cDHsasH"ormatsHlib'<!roc "ormat library ...< 4. library;'cDHsasH"ormatsHlib'<!roc library ...<

216. $hen creating a "ormat with the KABA@ statement, the new "ormat's name cannot end with a n mber cannot end with a !eriod cannot be the name o" a SAS "ormat, and 6. cannot be the name o" a data set variable. 2. m st be at least two characters long. 3. m st be at least eight characters long. 4. m st begin with a dollar sign 3*4 i" sed with a character variable. 212. $hich o" the "ollowing 2?/8A- !roced res is written correctly? 6. !roc "ormat lib;library val e color"mt< 6;'/ed' 2;'7reen' 3;'%l e' r n< 2. !roc "ormat lib;library< val e color"mt 6;'/ed' 2;'7reen' 3;'%l e'< r n< 3. !roc "ormat lib;library< val e color"mt< 6;'/ed' 2;'7reen' 3;'%l e' r n< 4. !roc "ormat lib;library< val e color"mt 6;'/ed'< 2;'7reen'< 3;'%l e'< r n< 213. $hich o" these is "alse? /anges in the KABA@ statement can s!eci"y 6. a single val e, s ch as 24 or 'S'. 2. a range o" n meric val es, s ch as 5N6#55. 3. a range o" character val es, s ch as 'A'N'8'. 4. a list o" n meric and character val es se!arated by commas, s ch as 15,'%',605,'(',2)5. 214. How many characters can be sed in a label? 6. 45 2. 1& 3. 255 4. 2#& 21#. $hich :eyword can be sed to label missing val es as well as any val es that are not s!eci"ied in a range? 6. B?$ 2. 8,SS 3. 8,SS,N7 4. ?-H@/ 21&. Co can !lace the 2?/8A- statement in either a (A-A ste! or a >/?' ste!. $hat ha!!ens when yo !lace the 2?/8A- statement in a (A-A ste!? 6. Co tem!orarily associate the "ormats with variables. 2. Co !ermanently associate the "ormats with variables. 3. Co re!lace the original data with the "ormat labels. 4. Co ma:e the "ormats available to other data sets. 21). -he "ormat L?%28- was created in a 2?/8A- !roced re. $hich 2?/8A- statement will a!!ly it to the variable Lob-itle in the !rogram o t! t? 1. "ormat Gobtitle Gob"mt< 2. "ormat Gobtitle Gob"mt.< 3. "ormat Gobtitle;Gob"mt< 4. "ormat Gobtitle;'Gob"mt'< 210. $hich :eyword, when added to the >/?' 2?/8A- statement, will dis!lay all the "ormats in yo r catalog? 6. 'A-AB?7 2. B,S-283. 28-'A4. 28-B,%

211. ," Style has "o r niE e val es and yo s bmit the "ollowing !rogram, which o t! t do yo get? 3Ass me that all the other variables are n meric.4 !roc re!ort data;sas ser.ho ses nowd< col mn style sE"eet bedrooms !rice< de"ine style Q gro !< r n< a. Style '?N(? /AN'H S>B,-$?S-?/C b. Style '?N(? SE2eet 6455 6315 265# 60&5 /AN'H 62#5 6#55 6#3# )25 S>B,6615 6&6# 635# -$?S-?/C 6065 6545 6245 6)4# c. %edrooms 2 3 4 2 2 3 3 6 6 4 3 4 2 2 4 >rice *05,5#5 *)1,3#5 *62),6#5 *665,)55 *&4,555 *0&,&#5 *01,655 *34,##5 *&#,0#5 *14,4#5 *)3,&#5 *65),2#5 *##,0#5 *&1,2#5 *652,1#5 SE2eet &)## #55# 4665 #03# %edrooms 66 1 0 62 >rice *31),2#5 *2)4,355 *233,1#5 *33#,355

Style 6# d. Style /AN'H S>B,'?N(? -$?S-?/C /AN'H S>B,S>B,'?N(? -$?S-?/C '?N(? /AN'H -$?S-?/C /AN'H -$?S-?/C '?N(? e.

SE2eet 26)5#

%edrooms 45

>rice *6,245,055

SE2eet 62#5 6615 6455 6065 6#55 6&6# 635# 6315 6545 265# 6#3# 6245 )25 6)4# 60&5

%edrooms 2 6 2 4 3 4 3 3 2 4 3 2 6 4 2

>rice *&4,555 *&#,0#5 *05,5#5 *65),2#5 *0&,&#5 *14,4#5 *)3,&#5 *)1,3#5 *##,0#5 *62),6#5 *01,655 *&1,2#5 *34,##5 *652,1#5 *665,)55

355. $hen yo de"ine an order variable, a. the detail rows are ordered according to their "ormatted val es. b. yo can't create s mmary re!orts. c. >/?' /@>?/- dis!lays only the "irst occ rrence o" each order variable val e in a set o" rows that have the same val e "or all order variables. d. all o" the above 356. $hich attrib tes or o!tions are re"lected in this >/?' /@>?/- o t! t? style SE2eet >rice

....................................

/AN'H -$?S-?/C S>B,-$?S-?/C

)25 6545 6615

*34,##5 *##,0#5

*&#,0#5 *&1,2#5

6245

/AN'H S>B,'?N(? '?N(? /AN'H /AN'H S>B,-$?S-?/C -$?S-?/C '?N(?

62#5 635# 6315 6455 6#55 6#3# 6&6#

*&4,555 *)3,&#5 *)1,3#5 *05,5#5 *0&,&#5 *01,655 *14,4#5 *652,1#5 *65),2#5 *665,)55

6)4# 6065 60&5

'?N(? 265# *62),6#5 a. SO,>B,N@ and 2?/8A-; b. '@N-@/, H@A(B,N@, H@A(SO,>, and either $,(-H;, S>A',N7;, or 2?/8A-; c. S>A',N7; only d. '@N-@/, 2?/8A-;, and H@A(B,N@ 352. -o create a s mmary re!ort that shows the average n mber o" bedrooms and the maxim m n mber o" baths "or each style o" ho se, which (@2,N@ statements do yo se in yo r >/?' /@>?/- ste!? a. b. c. d. e. ". g. h. i. G. :. l. de"ine style Q center 'Style o"QHo se'< de"ine bedrooms Q mean 'AverageQ%edrooms'< de"ine baths Q max '8axim mQ%aths'< de"ine style Q gro !< de"ine bedrooms Q mean 'AverageQ%edrooms'< de"ine baths Q max '8axim mQ%aths'< de"ine style Q order< de"ine bedrooms Q mean 'AverageQ%edrooms'< de"ine baths Q max '8axim mQ%aths'< de"ine style Q gro !< de"ine bedrooms Q 'AverageQ%edrooms'< de"ine baths Q '8axim mQ%aths'

353. $hich !rogram does not contain an error? a. b. c. d. e. ". g. h. i. r n< !roc re!ort data;sas ser.ho ses nowd< !roc re!ort data;sas ser.ho ses nowd< col mn style bedrooms baths< de"ine style Q order< de"ine bedbathratio Q com! ted "ormat;4.2< com! te bedbathratio< bedbathratio;baths.s mQbedrooms.s m< endcom!<

G. :. l. m. n. o. !. E. r. s. t. . v. w. x. y. 9. aa. bb. cc. dd. ee. "".

col mn style bedrooms baths %ed%ath/atio< de"ine style Q order< de"ine bedbathratio Q order "ormat;4.2< com! te bedbathratio< bedbathratio;baths.s mQbedrooms.s m< endcom!< r n< !roc re!ort data;sas ser.ho ses nowd< col mn style bedrooms baths %ed%ath/atio< de"ine style Q order< de"ine bedbathratio Q com! ted "ormat;4.2< com! te bedbathratio< bedbathratio;baths.s mQbedrooms.s m< endcom!< r n< !roc re!ort data;sas ser.ho ses nowd< col mn style bedrooms baths %ed%ath/atio< de"ine style Q order< de"ine bedbathratio Q com! ted "ormat;4.2< com! te bedbathratio< bedbathratio;bathsQbedrooms< endcom!< r n<

354. $hat o t! t does this >/?' /@>?/- ste! !rod ce? !roc re!ort data;sas ser.ho ses nowd< col mn style sE"eet bedrooms !rice< r n< a. b. c. d. a list re!ort ordered by val es o" the "irst variable in the '?BA8N statement a s mmary re!ort ordered by val es o" the "irst variable in the '?BA8N statement a list re!ort that dis!lays a row "or each observation in the in! t data set and which calc lates the SA8 statistic "or n meric variables a list re!ort that calc lates the N 3"reE ency4 statistic "or character variables

35#. $hich o" the "ollowing !rograms !rod ces this o t! t? Style '?N(? 4 a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. . v. r n< de"ine !rice Q mean 'Average >rice'< r n< !roc re!ort data;sas ser.ho ses nowd< col mn style !rice< de"ine style Q gro !< de"ine !rice Q mean 'Average >rice'< r n< !roc re!ort data;sas ser.ho ses nowd< col mn style !rice< de"ine style Q across< de"ine !rice Q mean 'Average >rice'< r n< !roc re!ort data;sas ser.ho ses nowd< col mn style !rice< de"ine style Q across ''?N(?' '/AN'H' 'S>B,-' '-$?S-?/C'< de"ine !rice Q mean 'Average >rice'< /AN'H 4 S>B,3 -$?S-?/C 4 Average >rice *02,)25

!roc re!ort data;sas ser.ho ses nowd< col mn style condo range s!lit twostory !rice<

35&. ," yo s bmit this !rogram, where does yo r >/?' /@>?/- o t! t a!!ear? !roc re!ort data;sas ser.ho ses nowd< col mn style sE"eet bedrooms !rice< de"ine style Q gro !< r n< a. b. c. d. in the >/?' /@>?/- window as H-8B andQor SAS listing o t! t both o" the above neither o" the above

35). How can yo create o t! t with headings that brea: as shown below? style o" Ho se '?N(? /AN'H S>B,Average %edrooms 2.)# 2.2# 2.&&&&&& 8axim m %aths 2.# 3 3

-$?S-?/C 3 3 a. Co m st s!eci"y the S>B,-; o!tion in the >/?' /@>?/- statement and se the s!lit character in col mn headings in (@2,N@ statements. b. Co m st se the de"a lt s!lit character in col mn headings in (@2,N@ statements. c. Co m st s!eci"y either the $,(-H; or the S>A',N7; attrib te in (@2,N@ statements. d. -hese headings s!lit this way by de"a lt. 350. S !!ose yo want to create a re!ort sing both character and n meric variables. ," yo don't se any (@2,N@ statements in yo r >/?' /@>?/- ste!, a. yo r >/?' /@>?/- ste! will not exec te s ccess" lly. b. yo can !rod ce only list re!orts. c. yo can order rows by s!eci"ying o!tions in the >/?' /@>?/- statement. d. yo can !rod ce only s mmary re!orts. 351. -he de"a lt statistics !rod ced by the 8@ANS !roced re are n.co nt, mean, minim m, maxim m, and a. median. b. range. c. standard deviation. d. standard error o" the mean. 365. $hich statement will limit a >/?' 8@ANS analysis to the variables %oarded, -rans"er, and (e!lane? a. by boarded trans"er de!lane< b. class boarded trans"er de!lane< c. o t! t boarded trans"er de!lane< d. var boarded trans"er de!lane< 366. -he data set S rvey.Health incl des the "ollowing variables. $hich is a !oor candidate "or >/?' 8@ANS analysis? a. ,(n m b. Age c. Height d. $eight 362. $hich o" the "ollowing statements is tr e regarding %C.gro ! !rocessing? a. %C variables m st be either indexed or sorted. b. S mmary statistics are com! ted "or %C variables. c. %C.gro ! !rocessing is !re"erred when yo are categori9ing data that contains "ew variables. d. %C.gro ! !rocessing overwrites yo r data set with the newly gro !ed observations. 363. $hich gro ! !rocessing statement !rod ced the >/?' 8@ANS o t! t shown below? S rvive (,@( Sex 6 N ?bs 4 Kariable Arterial Heart N 4 4 8ean 12.# 666.5 Std (ev 65.# #3.4 8inim m 03.5 #4.5 8axim m 653.5 603.5

S rvive

Sex

N ?bs

Kariable 'ardiac Arinary

N 4 4 & & & & # # # # # # # #

8ean 6)&.0 10.5 14.2 653.) 360.3 655.3 )).2 651.5 210.5 655.0 )0.0 655.5 335.2 666.2

Std (ev )#.2 60&.6 2).3 6&.) 652.& 6##.) 62.2 32.5 631.0 &5.2 &.0 63.4 0).5 6#2.4

8inim m 1#.5 5.5 )2.5 06.5 6#&.5 5.5 &6.5 )).5 &&.5 44.5 )2.5 04.5 2#&.5 62.5

8axim m 2&5.5 3)).5 64#.5 635.5 424.5 45#.5 00.5 641.5 465.5 255.5 0).5 666.5 4)6.5 3)).5

&

Arterial Heart 'ardiac Arinary

SA/K

Arterial Heart 'ardiac Arinary

Arterial Heart 'ardiac Arinary

a. b. c. d.

class sex s rvive< class s rvive sex< by sex s rvive< by s rvive sex<

364. $hich !rogram can be sed to create the "ollowing o t! t? Sex 2 N ?bs 66 Kariable Age Height $eight 8 1 Age Height $eight a. b. c. d. e. ". g. r n< !roc s mmary data;clinic.diabetes !rint< N 66 66 66 1 1 1 8ean 40.1515151 &3.1515151 6#5.4#4#4## 44.5555555 )5.&&&&&&) 254.2222222 Std (ev 63.35)##50 2.6616)&# 60.44&4020 62.301#66) 2.&4#)#63 35.20134#4 8inim m 6&.5555555 &6.5555555 652.5555555 6#.5555555 &&.5555555 645.5555555 8axim m &3.5555555 &0.5555555 6&0.5555555 #4.5555555 )#.5555555 245.5555555

!roc means data;clinic.diabetes< var age height weight< class sex< o t! t o t;wor:.s m+gender mean;AvgAge AvgHeight Avg$eight<

h. i. G. :. r n< l. m. n. o. !. E. r. 36#. %y de"a a. b. c. d.

var age height weight< class sex< o t! t o t;wor:.s m+gender mean;AvgAge AvgHeight Avg$eight<

!roc means data;clinic.diabetes no!rint< var age height weight< class sex< o t! t o t;wor:.s m+gender mean;AvgAge AvgHeight Avg$eight< r n< %oth a and b. lt, >/?' 2/@S creates a table o" "reE encies and !ercentages "or which data set variables? character variables n meric variables both character and n meric variables noneD variables m st always be s!eci"ied

36&. 2reE ency distrib tions wor: best with variables that contain a. contin o s val es. b. n meric val es. c. categorical val es. d. niE e val es. 36). $hich >/?' 2/@S ste! !rod ced this two.way table?

a. b. c. d.

!roc "reE data;clinic.diabetes< tables height weight< "ormat height ht"mt. weight wt"mt.<r n<

e. ". g. h. i. G. :. l. m. n. o. !.

!roc "reE data;clinic.diabetes< tables weight height< "ormat weight wt"mt. height ht"mt.< r n< !roc "reE data;clinic.diabetes< tables height=weight< "ormat height ht"mt. weight wt"mt.< r n< !roc "reE data;clinic.diabetes< tables weight=height< "ormat weight wt"mt. height ht"mt.< r n<

360. $hich >/?' 2/@S ste! !rod ced this table?

a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !.

!roc "reE data;clinic.diabetes< tables sex weight Q list< "ormat weight wt"mt.< r n< !roc "reE data;clinic.diabetes< tables sex=weight Q nocol< "ormat weight wt"mt.< r n< !roc "reE data;clinic.diabetes< tables sex weight Q norow nocol< "ormat weight wt"mt.< r n< !roc "reE data;clinic.diabetes< tables sex=weight Q no"reE norow nocol< "ormat weight wt"mt.< r n<

361. Asing ?(S statements, how many ty!es o" o t! t can yo generate conc rrently? a. 6 3only listing o t! t4 b. 2 c. 3 d. as an! as !o" #ant

325. ," ?(S is set to its de"a lt settings, what ty!es o" o t! t are created by the code below? ods html "ile;'cDHmyhtml.htm'< ods !d" "ile;'cDHmy!d".!d"'< a. H-8B and >(2 b. >(2 only c. H-8B, >(2, and listing d. No o t! t is created beca se ?(S is closed by de"a lt. 326. $hat is the ! r!ose o" closing the Bisting destination in the code shown below? ods listing close< ods html ... < a. ,t conserves system reso rces. b. ,t sim!li"ies yo r !rogram. c. ,t ma:es yo r !rogram com!atible with other hardware !lat"orms. d. ,t ma:es yo r !rogram com!atible with !revio s versions o" SAS so"tware. 322. $hen the code shown below is r n, what will the "ile (DH? t! tHbody.html contain? ods html body;'dDHo t! tHbody.html'< !roc !rint data;wor:.al!ha< r n< !roc !rint data;wor:.beta< r n< ods html close< a. -he >/?' >/,N- o t! t "or $or:.Al!ha. b. -he >/?' >/,N- o t! t "or $or:.%eta. c. -he >/?' >/,N- o t! t "or both $or:.Al!ha and $or:.%eta. d. Nothing. No o t! t will be written to (DH? t! tHbody.html. 323. $hen the code shown below is r n, what "ile will be loaded by the lin:s in (DH? t! tHcontents.html? ods html body;'dDHo t! tHbody.html' contents;'dDHo t! tHcontents.html' a. b. c. d. "rame;'dDHo t! tH"rame.html'< (DH? t! tHbody.html (DH? t! tHcontents.html (DH? t! tH"rame.html -here are no lin:s "rom the "ile (DH? t! tHcontents.html.

324. -he table o" contents created by the '?N-@N-S; o!tion contains a n mbered heading "or a. each !roced re. b. each !roced re that creates o t! t. c. each !roced re and (A-A ste!. d. each H-8B "ile created by yo r !rogram.

32#. $hen the code shown below is r n, what will the "ile (DH? t! tH"rame.html dis!lay? ods html body;'dDHo t! tHbody.html' contents;'dDHo t! tHcontents.html' a. b. c. d. "rame;'dDHo t! tH"rame.html'< -he "ile (DH? t! tHcontents.html. -he "ile (DH? t! tH"rame.html. -he "iles (DH? t! tHcontents.html and (DH? t! tHbody.html. ,t dis!lays no other "iles.

32&. $hat is the ! r!ose o" the A/B; s bo!tions shown below? ods html body;'dDHo t! tHbody.html' 3 rl;'body.html'4 contents;'dDHo t! tHcontents.html' 3 rl;'contents.html'4 a. b. c. d. "rame;'dDHo t! tH"rame.html'< -o create absol te lin: addresses "or loading the "iles "rom a server. -o create relative lin: addresses "or loading the "iles "rom a server. -o allow H-8B "iles to be loaded "rom a local drive. -o send H-8B o t! t to two locations.

32). $hich ?(S H-8B o!tion was sed in creating the "ollowing table?

a. b. c. d.

"ormat;brown "ormat;'brown' style;brown style;'brown'

320. $hat is the ! r!ose o" the >A-H; o!tion? ods html !ath;'dDHo t! t' 3 rl;none4 body;'body.html' contents;'contents.html' a. b. c. d. "rame;'"rame.html'< ,t creates absol te lin: addresses "or loading H-8B "iles "rom a server. ,t creates relative lin: addresses "or loading H-8B "iles "rom a server. ,t allows H-8B "iles to be loaded "rom a local drive. ,t s!eci"ies the location o" H-8B "ile o t! t.

321. $hich !rogram creates the o t! t shown below?

Stoc:N m 365 366 362 363 a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. . v. w. x.

2inish oa: ma!le brass glass

Style !edestal !edestal "loor table

,tem table table lam! lam!

-otal>rice 321.11 &11.10 ))1.1) 031.1&

data test2< in"ile " rnt re< in! t Stoc:N m * 6.3 2inish * #.1 Style * 66.60 ,tem * 25.24 >rice 2&.36< i" "inish;'oa:' then delete< retain -ot>rice 655< total!riceP!rice< dro! !rice< r n< !roc !rint data;test2 noobs< r n< data test2< in"ile " rnt re< in! t Stoc:N m * 6.3 2inish * #.1 Style * 66.60 ,tem * 25.24 >rice 2&.36< i" "inish;'oa:' and !riceM255 then delete< -otal>riceP!rice< r n< !roc !rint data;test2 noobs< r n< data test23dro!;!rice4< in"ile " rnt re< in! t Stoc:N m * 6.3 2inish * #.1 Style * 66.60 ,tem * 25.24 >rice 2&.36<

y. 9. aa. bb. cc. dd. ee. "". gg. hh. ii. GG. ::. ll.

i" "inish;'oa:' and !riceM255 then delete< -otal>riceP!rice< r n< !roc !rint data;test2 noobs< r n< data test2< in"ile " rnt re< in! t Stoc:N m * 6.3 2inish * #.1 Style * 66.60 ,tem * 25.24 >rice 2&.36< i" "inish;oa: and !riceM255 then delete !rice< -otal>riceP!rice< r n< !roc !rint data;test2 noobs< r n<

335. How is the variable Amo nt labeled and "ormatted in the >/?' >/,N- o t! t? data credit< in"ile creddata< in! t Acco nt * 6.# Name * ).2# -y!e * 2) -ransact * 21.3# Amo nt 3).#5< label amo nt;'Amo nt o" Boan'< "ormat amo nt dollar62.2<

r n< !roc !rint data;credit label< label amo nt;'-otal Amo nt Boaned'< "ormat amo nt comma65.< r n< a. b. c. d. label Amo nt o" Boan, "ormat (?BBA/62.2 label -otal Amo nt Boaned, "ormat '?88A65. label Amo nt, de"a lt "ormat -he >/?' >/,N- ste! does not exec te beca se two labels and two "ormats are assigned to the same variable.

336. 'onsider the ,2.-H@N statement shown below. $hen the statement is exec ted, which ex!ression is eval ated "irst? i" "inlexamF;1# and 3research;'A' or 3!roGect;'A' and !resent;'A'44 then 7rade;'AP'< a. "inlexamF;1# b. research;'A' c. !roGect;'A' and !resent;'A' d. research;'A' or 3!roGect;'A' and !resent;'A'4 332. 'onsider the small raw data "ile and !rogram shown below. $hat is the val e o" 'o nt a"ter the "o rth record is read?

a. b. c. d.

missing 5 35 )5

333. Now consider the revised !rogram below. $hat is the val e o" 'o nt a"ter the third observation is read?

a. b. c. d.

missing 5 655 635

334. 2or the observation shown below, what is the res lt o" the ,2.-H@N statement? Stat s o: -y!e 3 'o nt 62 Action @ 'ontrol 7o

i" stat s;'?O' and ty!e;3 then 'o ntP6< i" stat s;'S' or action;'@' then 'ontrol;'Sto!'< a. 'o nt ; 62 'ontrol ; 7o b. 'o nt ; 63 'ontrol ; Sto! c. 'o nt ; 62 'ontrol ; Sto! d. 'o nt ; 63 'ontrol ; 7o 33#. $hich o" the "ollowing can determine the length o" a new variable? a. the length o" the variable's "irst val e b. the assignment statement c. the B@N7-H statement d. all o" the above 33&. $hich set o" statements is the most e""icient eE ivalent to the code shown below? i" code;'6' then -y!e;'2ixed'< i" code;'2' then -y!e;'Kariable'< i" codeT;'6' and codeT;'2' then -y!e;'An:nown'< a. b. c. d. e. ". g. h. i. G. :. l. i" code;'6' then -y!e;'2ixed'< else i" code;'2' then -y!e;'Kariable'< else -y!e;'An:nown'< i" code;'6' then -y!e;'2ixed'< i" code;'2' then -y!e;'Kariable'< else -y!e;'An:nown'< i" code;'6' then ty!e;'2ixed'< else code;'2' and ty!e;'Kariable'< else ty!e;'An:nown'< i" code;'6' and ty!e;'2ixed'< then code;'2' and ty!e;'Kariable'< else ty!e;'An:nown'<

33). $hat is the length o" the variable -y!e, as created in the (A-A ste! below? data "inance.newloan< set "inance.records< -otBoanP!ayment< i" code;'6' then -y!e;'2ixed'< else -y!e;'Kariable'< length ty!e * 65< r n< a. b. c. d. # 0 65 ,t de!ends on the "irst val e o" -y!e.

330. $hich !rogram contains an error? a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. . v. w. x. y. data clinic.stress3dro!;timemin timesec4< in"ile tests< in! t ,( * 6.4 Name * &.2# /estH/ 2).21 8axH/ 36.33 /ecH/ 3#.3) -ime8in 31.45 -imeSec 42.43 -olerance * 4#< -otal-ime;3timemin=&54Ptimesec< S mSecPtotaltime< r n< !roc !rint data;clinic.stress< label totaltime;'-otal ( ration o" -est'< "ormat timemin #.2< dro! s msec< r n< !roc !rint data;clinic.stress3:ee!;totaltime timemin4< label totaltime;'-otal ( ration o" -est'< "ormat timemin #.2< r n< data clinic.stress< in"ile tests< in! t ,( * 6.4 Name * &.2# /estH/ 2).21 8axH/ 36.33 /ecH/ 3#.3) -ime8in 31.45 -imeSec 42.43 -olerance * 4#< -otal-ime;3timemin=&54Ptimesec< :ee! id totaltime tolerance< r n<

331. ," yo s bmit the "ollowing !rogram, which variables a!!ear in the new data set? data wor:.cardiac3dro!;age gro !4< set clinic."itness3:ee!;age weight gro !4< i" gro !;2 and ageF45< r n< a. b. c. d. none $eight Age, 7ro ! Age, $eight, 7ro !

345. $hich o" the "ollowing !rograms correctly reads the data set ?rders and creates the data set 2ast?rdr? a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. data catalog."astordr3dro!;ordrtime4< set G ly.orders3:ee!;!rod ct nits !rice4< i" ordrtimeM4< -otal; nits=!rice< r n< data catalog.orders3dro!;ordrtime4< set G ly."astordr3:ee!;!rod ct nits !rice4< i" ordrtimeM4< -otal; nits=!rice< r n< data catalog."astordr3dro!;ordrtime4< set G ly.orders3:ee!;!rod ct nits !rice ordrtime4< i" ordrtimeM4< -otal; nits=!rice< r n< none o" the above

346. $hich o" the "ollowing statements is "alse abo t %C.gro ! !rocessing? $hen yo se the %C statement with the S@- statement, a. the data sets that are listed in the S@- statement m st be indexed or sorted by the val es o" the %C variable3s4. b. the (A-A ste! a tomatically creates two variables, 2,/S-. and BAS-., "or each variable in the %C statement. c. 2,/S-. and BAS-. identi"y the "irst and last observation in each %C gro !, in that order. d. 2,/S-. and BAS-. are stored in the data set.

342. -here are #55 observations in the data set 'om!any.ASA. $hat is the res lt o" s bmitting the "ollowing !rogram? data wor:.getobs#3dro!;obsn m4< obsn m;#< set com!any. sa3:ee!;manager !ayroll4 !oint;obsn m< sto!< r n< a. b. c. d. an error an em!ty data set a contin o s loo! a data set that contains one observation

343. -here is no end.o"."ile condition when yo se direct access to read data, so how can yo r !rogram !revent a contin o s loo!? a. (o not se a >?,N-; variable. b. 'hec: "or an invalid val e o" the >?,N-; variable. c. (o not se an @N(; variable. d. ,ncl de an ?A->A- statement. 344. Ass ming that the data set 'om!any.ASA has "ive or more observations, what is the res lt o" s bmitting the "ollowing !rogram? data wor:.getobs#3dro!;obsn m4< obsn m;#< set com!any. sa3:ee!;manager !ayroll4 !oint;obsn m< o t! t< sto!< r n< a. b. c. d. an error an em!ty data set a contin o s loo! a data set that contains one observation

34#. $hich o" the "ollowing statements is tr e regarding direct access o" data sets? a. Co cannot s!eci"y @N(; with >?,N-;. b. Co cannot s!eci"y ?A->A- with >?,N-;. c. Co cannot s!eci"y S-?> with @N(;. d. Co cannot s!eci"y 2,/S-. with BAS-.

34&. $hat is the res lt o" s bmitting the "ollowing !rogram? data wor:.addtoend< set clinic.stress2 end;last< i" last< r n< a. b. c. d. an error an em!ty data set a contin o s loo! a data set that contains one observation

34). At the start o" (A-A ste! !rocessing, d ring the com!ilation !hase, variables are created in the !rogram data vector 3>(K4, and observations are set to a. blan: b. missing c. 5 d. there are no observations. 340. -he (A-A ste! exec tes a. contin o sly i" yo se the >?,N-; o!tion and the S-?> statement. b. once "or each variable in the o t! t data set. c. once "or each observation in the in! t data set. d. ntil it enco nters an ?A->A- statement. 341. $hich !rogram will combine %rothers.?ne and %rothers.-wo to !rod ce %rothers.-hree?

a. b. c. d. e. ". g. h. i. G. :. l. m. n. o.

data brothers.three< set brothers.one< set brothers.two< r n< data brothers.three< set brothers.one brothers.two< r n< data brothers.three< set brothers.one brothers.two< by varx< r n< data brothers.three< merge brothers.one brothers.two< by varx< r n<

3#5. $hich !rogram will combine Actors.>ro!s6 and Actors.>ro!s2 to !rod ce Actors.>ro!s3?

a. b. c. d. e. ". g. h. i. G. :. l. m. n. o.

data actors.!ro!s3< set actors.!ro!s6< set actors.!ro!s2< r n< data actors.!ro!s3< set actors.!ro!s6 actors.!ro!s2< r n< data actors.!ro!s3< set actors.!ro!s6 actors.!ro!s2< by actor< r n< data actors.!ro!s3< merge actors.!ro!s6 actors.!ro!s2< by actor< r n<

3#6. ," yo s bmit the "ollowing !rogram, which new data set is created?

data wor:.Gobsatis< set wor:.dataone wor:.datatwo< r n< a. 'areer )2 &3 S !ervis 2& )& 2inance 1 ) Kariety . . 2eedbac: . . . A tonomy .

'areer 1& 1& 04 . . . . . b. 'areer )2 &3 1& 1& 04 c. 'areer )2 &3 1& 1&

S !ervis 36 10 14 . . . . .

2inance ) & & . . . . .

Kariety . . . 65 0# 03 02 3&

2eedbac: . . . 66 22 &3 )# ))

A tonomy . . . )5 13 )3 1) 1)

S !ervis 2& )& 36 10 14

2inance 1 ) ) & &

Kariety 65 0# 03 02 3&

2eedbac: 66 22 &3 )# ))

A tonomy )5 13 )3 1) 1)

S !ervis 2& )& 36 10

2inance 1 ) ) &

'areer 04 65 0# 03 02 3&

S !ervis 14 66 22 &3 )# ))

2inance & )5 13 )3 1) 1)

d. none o" the above ans a< 3#2. ," yo concatenate the data sets below in the order shown, what is the val e o" Sale in observation 2 o" the new data set?

a. b. c. d.

missing *35,555 *45,555 yo cannot concatenate these data sets

3#3. $hat ha!!ens i" yo merge the "ollowing data sets by variable SSN?

a. b. c. d.

-he val es o" Age in the 6st data set overwrite the val es o" Age in the 2nd data set. -he val es o" Age in the 2nd data set overwrite the val es o" Age in the 6st data set. -he (A-A ste! "ails beca se the two data sets contain same.named variables that have di""erent val es. -he val es o" Age in the 2nd data set are set to missing.

3#4. S !!ose yo merge data sets Health.Set6 and Health.Set2 belowD

$hich o t! t does the "ollowing !rogram create? data wor:.merged< merge health.set63in;in64 health.set23in;in24< by id< i" in6 and in2< r n< !roc !rint data;wor:.merged< r n< a. ?bs 6 2 3 4 ,( 6621 62)4 630) 2354 Sex 2 2 2 2 Age 40 #5 #) 6& Height &6 . &4 &6 $eight 63) . 642 652

?bs # & ) 0 1 65 66 b. ?bs 6 2 3 4 # & ) 0 1 65 66 c.

,( 240& 442# 4)#1 #430 &400 1562 162#

Sex 2 2 2 2 2 2 2

Age &3 40 &5 42 #1 31 #&

Height . . . &2 &4 &3 &4

$eight . . . 6&0 6#4 6#) 6#1

,( 6621 630) 2354 #430 &400 1562 162# #430 &400 1562 162#

Sex 2 2 2 2 2 2 2 2 2 2 2

Age 40 #5 #) 6& &3 40 &5 42 #1 31 #&

Height &6 &4 &6 &2 &4 &3 &4 . . . .

$eight 63) 642 652 6&0 6#4 6#) 6#1 . . . .

?bs 6 2 3 4 # & ) d.

,( 6621 630) 2354 #430 &400 1562 162#

Sex 2 2 2 2 2 2 2

Age 40 #) 6& 42 #1 31 #&

Height &6 &4 &6 &2 &4 &3 &4

$eight 63) 642 652 6&0 6#4 6#) 6#1

none o" the above ans c

3##. -he data sets @nsemble.S!ring and @nsemble.S mmer both contain a variable named %l e. How do yo !revent the val es o" the variable %l e "rom being overwritten when yo merge the two data sets? a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. r n< r n< data ensemble.merged< merge ensemble.s!ring3rename;3bl e;navy44 ensemble.s mmer< by "abric< r n< data ensemble.merged< merge ensemble.s!ring3bl e;navy4 ensemble.s mmer< by "abric< r n< data ensemble.merged< merge ensemble.s!ring3o t;bl e4 ensemble.s mmer< by "abric< data ensemble.merged< merge ensemble.s!ring3in;bl e4 ensemble.s mmer< by "abric<

3#&. $hat ha!!ens i" yo s bmit the "ollowing !rogram to merge %lood.(onors6 and %lood.(onors2, shown below?

data wor:.merged< merge blood.donors6 blood.donors2< by id< r n<

a. b. c. d.

-he 8erged data set contains some missing val es beca se not all observations have matching observations in the other data set. -he 8erged data set contains 0 observations. -he (A-A ste! !rod ces errors. Kal es "or Anits in %lood.(onors2 overwrite val es "or Anits in %lood.(onors6.

3#). ," yo merge 'om!any.Sta""6 and 'om!any.Sta""2 below by ,(, how many observations does the new data set contain?

a. b. c. d.

4 # & 1

3#0. ," yo merge data sets Sales./e!s, Sales.'lose, and Sales.%on s by ,(, what is the val e o" %on s in the third observation in the new data set?

a. b. c. d. 3#1. $hich " a. b. c. d.

*4,555 *3,555 missing can't tell "rom the in"ormation given nction calc lates the average o" the variables Kar6, Kar2, Kar3, and Kar4? mean3var6,var44 mean3var6.var44 mean3o" var6,var44 mean3o" var6.var44

3&5. $ithin the data set Hrd.-em!, >ay/ate is a character variable and Ho rs is a n meric variable. $hat ha!!ens when the "ollowing !rogram is r n? data wor:.tem!< set hrd.tem!< Salary;!ayrate=ho rs< r n< a. b. c. d. SAS converts the val SAS converts the val SAS converts the val SAS converts the val es o" >ay/ate to n meric val es. No message is written to the log. es o" >ay/ate to n meric val es. A message is written to the log. es o" Ho rs to character val es. No message is written to the log. es o" Ho rs to character val es. A message is written to the log.

3&6. A ty!ical val e "or the character variable -arget is 623,4#&. $hich statement correctly converts the val es o" -arget to n meric val es when creating the variable -argetNo? a. -argetNo;in! t3target,comma&.4< b. -argetNo;in! t3target,comma).4< c. -argetNo;! t3target,comma&.4< d. -argetNo;! t3target,comma).4< 3&2. A ty!ical val e "or the n meric variable SiteN m is 62.3. $hich statement correctly converts the val es o" SiteN m to character val es when creating the variable Bocation? a. Bocation;de!tUU'Q'UUin! t3siten m,3.64< b. Bocation;de!tUU'Q'UUin! t3siten m,4.64< c. Bocation;de!tUU'Q'UU! t3siten m,3.64< d. Bocation;de!tUU'Q'UU! t3siten m,4.64< 3&3. S !!ose the C@A/'A-?22; system o!tion is set to 6125. $hich 8(C " nction creates the date val e "or Lan ary 3, 2525? a. 8(C36,3,254 b. 8(C33,6,254 c. 8(C36,3,25254 d. 8(C33,6,25254

3&4. -he variable Address2 contains val es s ch as >iscataway, NL. How do yo assign the two.letter state abbreviations to a new variable named State? a. State;scan3address2,24< b. State;scan3address2,63,24< c. State;s bstr3address2,24< d. State;s bstr3address2,63,24< 3&#. -he variable ,('ode contains val es s ch as 6232A and 3268%. -he "o rth character identi"ies sex. How do yo assign these character codes to a new variable named Sex? a. Sex;scan3idcode,44< b. Sex;scan3idcode,4,64< c. Sex;s bstr3idcode,44< d. Sex;s bstr3idcode,4,64< 3&&. ( e to growth within the 161 area code, the tele!hone exchange ### is being reassigned to the 125 area code. -he data set 'lients.>iedmont incl des the variable >hone, which contains tele!hone n mbers in the "orm 161.###.6234. $hich o" the "ollowing !rograms will correctly change the val es o" >hone? a. data wor:.!iedmont3dro!;areacode exchange4< set clients.!iedmont< Areacode;s bstr3!hone,6,34< @xchange;s bstr3!hone,#,34< i" areacode;'161' and exchange;'###' then scan3!hone,6,34;'125'< r n< b. data wor:.!iedmont3dro!;areacode exchange4< set clients.!iedmont< Areacode;s bstr3!hone,6,34< @xchange;s bstr3!hone,#,34< i" areacode;'161' and exchange;'###' then !hone;scan3'125',6,34< r n< c. data wor:.!iedmont3dro!;areacode exchange4< set clients.!iedmont< Areacode;s bstr3!hone,6,34< @xchange;s bstr3!hone,#,34< i" areacode;'161' and exchange;'###' then s bstr3!hone,6,34;'125'< r n< d. data wor:.!iedmont3dro!;areacode exchange4< set clients.!iedmont< Areacode;s bstr3!hone,6,34< @xchange;s bstr3!hone,#,34< i" areacode;'161' and exchange;'###' then !hone;s bstr3'125',6,34< r n< 3&). S !!ose yo need to create the variable 2 llName by concatenating the val es o" 2irstName, which contains "irst names, and BastName, which contains last names. $hat's the best way to remove extra blan:s between "irst names and last names? a. data wor:.maillist< set retail.maillist< length 2 llName * 45< " llname;trim "irstnameUU' 'UU lastname< r n< b. data wor:.maillist< set retail.maillist< length 2 llName * 45< " llname;trim3"irstname4UU' 'UU lastname< r n< c. data wor:.maillist< set retail.maillist< length 2 llName * 45< " llname;trim3"irstname4UU' 'UU trim3lastname4<r n< d. data wor:.maillist< set retail.maillist< length 2 llName * 45< " llname;trim3"irstnameUU' 'UU lastname4< r n< 3&0. $ithin the data set 2 rnit r.%oo:case, the variable 2inish contains val es s ch as ashQcherryQtea:Qmatte.blac:. $hich o" the "ollowing creates a s bset o" the data in which the val es o" 2inish contain the string waln t? 8a:e the search "or the string case.insensitive. a. data wor:.boo:case< set " rnit r.boo:case< i" index3"inish,waln t4 ; 5< r n< b. data wor:.boo:case< set " rnit r.boo:case< i" index3"inish,'waln t'4 F 5< r n< c. data wor:.boo:case< set " rnit r.boo:case< i" index3lowcase3"inish4,waln t4 ; 5< r n< d. data wor:.boo:case< set " rnit r.boo:case< i" index3lowcase3"inish4,'waln t'4 F 5<r n< 3&1. $hich statement is "alse regarding the se o" (? loo!s? a. -hey can contain conditional cla ses. b. -hey can generate m lti!le observations. c. -hey can be sed to combine (A-A and >/?' ste!s. d. -hey can be sed to read data.

3)5. ( ring each exec tion o" the "ollowing (? loo!, the val e o" @arned is calc lated and is added to its !revio s val e. How many times does this (? loo! exec te? data "inance.earnings< Amo nt;6555< /ate;.5)#Q62< do month;6 to 62< @arnedP3amo ntPearned4=rate< end< r n< a. b. c. d. 5 6 62 63

3)6. ?n Lan ary 6 o" each year, *#,555 is invested in an acco nt. 'om!lete the (A-A ste! below to determine the val e o" the acco nt a"ter 6# years i" a constant interest rate o" 65V is ex!ected. data wor:.invest< ... 'a!italP#555< ca!italP3ca!ital=.654< end< r n< a. b. c. d. do co do co do co do co nt;6 to 6#< nt;6 to 6# by 65V< nt;6 to ca!ital< nt;ca!ital to 3ca!ital=.654<

3)2. ,n the data set $or:.,nvest, what wo ld be the stored val e "or Cear? data wor:.invest< do year;6115 to 2554< 'a!italP#555< ca!italP3ca!ital=.654< end< r n< a. b. c. d. missing 6115 2554 255#

3)3. $hich o" the "ollowing statements is "alse regarding the !rogram shown below? data wor:.invest< do year;6115 to 2554< 'a!italP#555< ca!italP3ca!ital=.654< o t! t< end< r n< a. b. c. d. -he ?A->A- statement writes c rrent val es to the data set immediately. -he stored val e "or Cear is 255#. -he ?A->A- statement overrides the a tomatic o t! t at the end o" the (A-A ste!. -he (? loo! !er"orms 6# iterations.

3)4. How many observations will the data set $or:.@arn contain? data wor:.earn< Kal e;2555< do year;6 to 25< ,nterest;val e=.5)#< val ePinterest< o t! t< end< r n< a. b. c. d. 5 6 61 25

3)#. $hich o" the "ollowing wo ld yo se to com!are the res lt o" investing *4,555 a year "or "ive years in three di""erent ban:s that com!o nd interest monthly? Ass me a "ixed rate "or the "ive.year !eriod. a. (? $H,B@ statement b. nested (? loo!s c. (? AN-,B statement d. a (? gro ! 3)&. $hich statement is "alse regarding (? AN-,B statements? a. -he condition is eval ated at the to! o" the loo!, be"ore the enclosed statements are exec ted. b. -he enclosed statements are always exec ted at least once. c. SAS statements in the (? loo! are exec ted ntil the s!eci"ied condition is tr e. d. -he (? loo! m st have a closing @N( statement.

3)). Select the (? $H,B@ statement that wo ld generate the same res lt as the !rogram below. data wor:.invest< ca!ital;655555< do ntil3'a!ital gt #555554< CearP6< ca!italP3ca!ital=.654< end< r n< a. b. c. d. do while3'a!ital ge #555554< do while3'a!ital;#555554< do while3'a!ital le #555554< do while3'a!italM#555554<

3)0. ,n the "ollowing !rogram, com!lete the statement so that the !rogram sto!s generating observations when (istance reaches 2#5 miles or when 65 gallons o" " el have been sed. data wor:.go2#5< set !erm.cars< do gallons;6 to 65 ... < (istance;gallons=m!g< o t! t< end< r n< a. b. c. d. while3(istanceM2#54 when3(istanceF2#54 over3(istance le 2#54 ntil3(istance;2#54

3)1. $hich statement is "alse regarding an A//AC statement? a. ,t is an exec table statement. b. ,t can be sed to create variables. c. ,t m st contain either all n meric or all character elements. d. ,t m st be sed to de"ine an array be"ore the array name can be re"erenced. 305. $hat belongs within the braces o" this A//AC statement? array contribW?X Etr6.Etr4< a. E arter b. E arter= c. 6.4 d. 4

306. 2or the !rogram below, select an iterative (? statement to !rocess all elements in the contrib array. data wor:.contrib< array contribW4X Etr6.Etr4< ... contribWiX;contribWiX=6.2#< end< r n< a. b. c. d. do i;4< do i;6 to 4< do ntil i;4< do while i le 4<

302. $hat is the val e o" the index variable that re"erences L l in the statements below? array E arterW4X Lan A!r L l ?ct< do i;6 to 4< yeargoal;E arterWiX=6.2< end< a. b. c. d. 6 2 3 4

303. $hich (? statement wo ld not !rocess all the elements in the "actors array shown below? array "actorsW=X age height weight blood!r< a. do i;6 to dim3"actors4< b. do i;6 to dim3=4< c. do i;6,2,3,4< d. do i;6 to 4< 304. $hich statement below is "alse regarding the se o" arrays to create variables? a. -he variables are added to the !rogram data vector d ring the com!ilation o" the (A-A ste!. b. Co do not need to s!eci"y the array elements in the A//AC statement. c. %y de"a lt, all character variables are assigned a length o" eight. d. ?nly character variables can be created.

30#. 2or the "irst observation, what is the val e o" di""WiX at the end o" the second iteration o" the (? loo!? $eight6 612 63) 225 $eight2 255 635 265 $eight3 26# 62# 263

array wtW=X weight6.weight65< array di""W1X< do i;6 to 1< di""WiX;wtWiP6X.wtWiX< end< a. b. c. d. 6# 65 0 .)

30&. 2inish the A//AC statement below to create tem!orary array elements that have initial val es o" 1555, 1355, 1&55, and 1155. array goalW4X ... < a. +tem!orary+ 31555 1355 1&55 11554 b. tem!orary 31555 1355 1&55 11554 c. +tem!orary+ 1555 1355 1&55 1155 d. 3tem!orary4 1555 1355 1&55 1155 30). %ased on the A//AC statement below, select the array re"erence "or the array element E#5. array E a. b. c. d. esW3,2#X E6.E)#< E esWE#5X E esW6,#5X E esW2,2#X E esW3,5X

300. Select the A//AC statement that de"ines the array in the "ollowing !rogram. data rainwear.coat< in! t category high6.high3 Q low6.low3< ... do i;6 to 2< do G;6 to 3< com!areWi,GX;ro nd3com!areWi,GX=6.624< end<

end< r n< a. b. c. d. array com!areW6,&X high6.high3 low6.low3< array com!areW2,3X high6.high3 low6.low3< array com!areW3,2X high6.high3 low6.low3< array com!areW3,3X high6.high3 low6.low3<

301. $hich SAS statement correctly ses col mn in! t to read the val es in the raw data "ile below in this orderD Address 34th "ield4, SE are2eet 3second "ield4, Style 3"irst "ield4, %edrooms 3third "ield4?

a. b. c. d. e. ". g. h.

in! t Address 6#.21 SE are2eet 0.66 Style 6.& %edrooms 63< in! t * 6#.21 Address 0.66 SE are2eet * 6.& Style 63 %edrooms< in! t Address * 6#.21 SE are2eet 0.66 Style * 6.& %edrooms 63< in! t Address 6#.21 * SE are2eet 0.66 Style 6.& * %edrooms 63<

315. $hich is not an advantage o" col mn in! t? a. ,t can be sed to read character variables that contain embedded blan:s. b. No !laceholder is reE ired "or missing data. c. Standard as well as nonstandard data val es can be read. d. 2ields do not have to be se!arated by blan:s or other delimiters. 316. $hich is an exam!le o" standard n meric data? a. .34.24# b. *24,234.2# c. 6Q2 d. #5V 312. 2ormatted in! t can be sed to read a. standard "ree."ormat data b. standard data in "ixed "ields c. nonstandard data in "ixed "ields d. both standard and nonstandard data in "ixed "ields 313. $hich in"ormat sho ld yo se to read the val es in col mn 6.#?

a. b. c. d.

w. *w. w.d '?88Aw.d

314. -he '?88Aw.d in"ormat can be sed to read which o" the "ollowing val es? a. 62,05# b. *6)).1# c. 60 V d. all o" the above 31#. $hich ,N>A- statement correctly reads the val es "or 8odelN mber 3"irst "ield4 a"ter the val es "or ,tem 3second "ield4? %oth ,tem and 8odelN mber are character variables.

a. b. c. d.

in! in! in! in!

t P) ,tem *1. Y6 8odelN t P& ,tem *1. Y6 8odelN t Y) ,tem *1. P6 8odelN t Y) ,tem *1 Y6 8odelN

mber *#.< mber *#.< mber *#.< mber #.<

31&. $hich ,N>A- statement correctly reads the n meric val es "or 'ost 3third "ield4?

a. b. c. d.

in! in! in! in!

t Y6) 'ost ).2< t Y6) 'ost 1.2.< t Y6) 'ost comma).< t Y6) 'ost comma1.<

31). $hich SAS statement correctly ses "ormatted in! t to read the val es in this orderD ,tem 3"irst "ield4, Anit'ost 3second "ield4, S antity 3third "ield4?

a. b. c. d. e. ". g.

in! t Y6 ,tem *1. P6 Anit'ost comma&. Y60 S antity 3.< in! t ,tem *1. Y66 Anit'ost comma&. Y60 S antity 3.< in! t ,tem *1. P6 Anit'ost comma&. Y60 S antity 3.< all o" the above

310. $hich raw data "ile reE ires the >A( o!tion in the ,N2,B@ statement in order to correctly read the data sing either col mn in! t or "ormatted in! t? a.

b.

c.

d.

311. -he raw data "ile re"erenced by the "ilere" St dents contains data that is

a. b. c. d.

arranged in "ixed "ields "ree "ormat mixed "ormat arranged in col mns

455. $hich in! t style sho ld be sed to read the val es in the raw data "ile that is re"erenced by the "ilere" St dents?

a. b. c. d.

col mn "ormatted list mixed

456. $hich SAS !rogram was sed to create the raw data "ile -eamdat "rom the SAS data set $or:.Scores? SAS (ata Set $or:.Scores ?bs 6 2 3 4 Name Loe (ani Bisa 8atthew HighScore 0) )1 0# )& -eam %l e %eetles, ( rham /aleigh /acers, /aleigh Sand Shar:s, 'ary %l e %eetles, ( rham

a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t. .

data +n ll+< set wor:.scores< "ile 'cDHdataHteamdat' dlm;','< ! t name highscore team< r n< data +n ll+< set wor:.scores< "ile 'cDHdataHteamdat' dlm;' '< ! t name highscore team< r n< data +n ll+< set wor:.scores< "ile 'cDHdataHteamdat' dsd< ! t name highscore team< r n< data +n ll+< set wor:.scores< "ile 'cDHdataHteamdat'< ! t name highscore team< r n<

452. $hich SAS statement reads the raw data val es in order and assigns them to the variables shown below? KariablesD 2irstName 3character4, BastName 3character4, Age 3n meric4, School 3character4, 'lass 3n meric4

a. b. c. d. e. ".

in! t 2irstName * BastName * Age School * 'lass< in! t 2irstName BastName Age School 'lass< in! t 2irstName * 6.4 BastName * &.62 Age 64.6# School * 6).61 'lass 26< in! t 2irstName 6.4 BastName &.62 Age 64.6# School 6).61 'lass 26<

453. $hich SAS statement sho ld be sed to read the raw data "ile that is re"erenced by the "ilere" Salesre!?

a. b. c. d.

in"ile salesre!< in"ile salesre! 'D'< in"ile salesre! dlm< in"ile salesre! dlm;'D'<

454. $hich o" the "ollowing raw data "iles can be read by sing the 8,SS?K@/ o!tion in the ,N2,B@ statement? 8issing val es are indicated with colored bloc:s. a.

b.

c.

d.

a 45#. $hich SAS !rogram correctly reads the data in the raw data "ile that is re"erenced by the "ilere" Kol nteer?

a. b. c. d.

data !erm.contest< in"ile vol nteer< in! t 2irstName * BastName * Age School * 'lass< r n<

e. ". g. h. i. G. :. l. m. n. o. !. E. r.

data !erm.contest< in"ile vol nteer< length BastName * 66< in! t 2irstName * lastname * Age School * 'lass< r n< data !erm.contest< in"ile vol nteer< in! t 2irstName * lastname * Age School * 'lass< length BastName * 66< r n< data !erm.contest< in"ile vol nteer< in! t 2irstName * BastName * 66. Age School * 'lass< r n<

45&. $hich ty!e o" in! t sho ld be sed to read the val es in the raw data "ile that is re"erenced by the "ilere" Aniversity?

a. b. c. d.

col mn "ormatted list modi"ied list

45). $hich SAS statement correctly reads the val es "or 2lavor and S antity? 8a:e s re the length o" each variable can accommodate the val es that are shown.

a. b. c. d.

in! t 2lavor Z *1. S antity D comma.< in! t 2lavor Z *64. S antity D comma.< in! t 2lavor D *64. S antity Z comma.< in! t 2lavor *64. S antity D comma.<

450. $hich SAS statement correctly reads the raw data val es in order and assigns them to these corres!onding variablesD Cear 3n meric4, School 3character4, @nrolled 3n meric4?

a. b. c. d. e. ". g.

in! t Cear School Z *2). @nrolled D comma.< in! t Cear 6.4 School Z *2). @nrolled D comma.< in! t Y6 Cear 4. P6 School Z *2). @nrolled D comma.< all o" the above

451. SAS date val es are the n mber o" days since which date? a. Lan ary 6, 6155 b. Lan ary 6, 61#5 c. Lan ary 6, 61&5 d. Lan ary 6, 61)5

465. A great advantage o" storing dates and times as SAS n meric date and time val es is that a. they can easily be edited. b. they can easily be read and nderstood. c. they can be sed in text strings li:e other character val es. d. they can be sed in calc lations li:e other n meric val es. 466. SAS does not a tomatically ma:e adG stments "or daylight saving time, b t it does ma:e adG stments "or a. lea! seconds b. lea! years c. L lian dates d. time 9ones 462. An in! t data "ile has date ex!ressions in the "orm 65222556. $hich SAS in"ormat sho ld yo read these dates? a. (A-@&. b. (A-@0. c. 88((CC&. d. 88((CC0. 463. -he minim m width o" the -,8@w. in"ormat is a. 4 b. # c. & d. ) 464. Shown below are date and time ex!ressions and corres!onding SAS datetime in"ormats. $hich date and time ex!resssion cannot be read by the in"ormat that is shown beside it? a. 358ay2555D65D53D6).2 (A-@-,8@25. b. 358ay55 65D53D6).2 (A-@-,8@60. c. 358ay2555Q65D53 (A-@-,8@6#. d. 358ay2555Q6553 (A-@-,8@64. 46#. $hat is the de"a lt val e o" the C@A/'A-?22; system o!tion? a. 6125 b. 6165 c. 6155 d. 6135 46&. S !!ose yo r in! t data "ile contains the date ex!ression 63A>/2551. -he C@A/'A-?22; system o!tion is set to 6165. SAS will read the date as a. 63A>/6151 b. 63A>/6125 c. 63A>/2551 d. 63A>/2525 46). S !!ose the C@A/'A-?22; system o!tion is set to 6125. An in! t "ile contains the date ex!ression 62Q50Q612#, which is being read with the 88((CC0. in"ormat. $hich date will a!!ear in yo r data? a. 50(@'6125 b. 50(@'612# c. 50(@'2561 d. 50(@'252# 460. S !!ose yo r !rogram creates two variables "rom an in! t "ile. %oth variables are stored as SAS date val esD 2irst(ay records the start o" a billing cycle, and Bast(ay records the end o" that cycle. -he code "or calc lating the total n mber o" days in the cycle wo ld be a. -ot(ays;lastday."irstday< b. -ot(ays;lastday."irstdayP6< c. -ot(ays;lastdayQ"irstday< d. Co cannot se date val es in calc lations. se to

461. Co can !osition the in! t !ointer on a s!eci"ic record by sing a. col mn !ointer controls. b. col mn s!eci"ications. c. line !ointer controls. d. line hold s!eci"iers. 425. $hich !ointer control is sed to read m lti!le records seE entially? a. Yn b. Pn c. Q d. all o" the above 426. $hich !ointer control can be sed to read records non.seE entially? a. Yn b. [n c. Pn d. Q 422. $hich SAS statement correctly reads the val es "or 2name, Bname, Address, 'ity, State, and \i! in order?

a. b. c. d. e. ". g. h. i. G. :. l.

in! t 2name * Bname * Q Address *25. Q 'ity * State * \i! *< in! t 2name * Bname * Q< Address *25. Q< 'ity * State * \i! *< in! t Q 2name * Bname * Q Address *25. 'ity * State * \i! *< in! t Q 2name * Bname *< Q Address *25.< 'ity * State * \i! *<

423. $hich ,N>A- statement correctly reads the val es "or ,( in the "o rth record, then ret rns to the "irst record to read the val es "or 2name and Bname?

a. b. c. d. e. ". g.

in! t [4 ,( *#. [6 2name * Bname *< in! t [4 ,( * 6.# [6 2name * Bname *< in! t [4 ,( * [6 2name * Bname *< all o" the above

424. How many records will be read "or each iteration o" the (A-A ste!?

data s!ring.s!ortswr< in"ile newitems< in! t [6 ,tem * 'olor * [3 Y0 >rice comma&. [2 2abric * [3 SOA * 6.&< r n< a. b. c. d. one two three "o r

42#. $hich ,N>A- statement correctly reads the val es "or 'ity, State, and \i!?

a. b. c. d.

in! t [3 'ity * State * \i! *< in! t [3 'ity Z *66. State * \i! *< in! t [3 'ity *66. P2 State *2. P 2 \i! *#.< all o" the above

42&. $hich !rogram does not read the val es in the "irst record as a variable named ,tem and the val es in the second record as two variables named ,nventory and -y!e?

a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !. E. r. s. t.

data !erm.s !!lies< in"ile instoc: !ad< in! t ,tem Z *6&. Q ,nventory 2. -y!e *0.< r n< data !erm.s !!lies< in"ile instoc: !ad< in! t ,tem Z *6&. Q ,nventory 2. -y!e *0.< r n< data !erm.s !!lies< in"ile instoc: !ad< in! t [6 ,tem Z *6&. ,nventory 2. -y!e *0.< r n< data !erm.s !!lies< in"ile instoc: !ad< in! t ,tem Z *6&. [2 ,nventory 2. -y!e *0.< r n<

42). $hich ,N>A- statement reads the val es "or Bname, 2name, (e!artment, and Salary 3in that order4?

a. b. c. d. e.

in! t [6 Bname * 2name * Q (e!artment *62. Salary comma65.< in! t [6 Bname * 2name * Q (e!artment D *62. Salary D comma.< in! t [6 Bname * 2name *

". g.

[2 (e!artment D *62. Salary D comma.< both b and c

420. $hich raw data "ile !oses !otential !roblems when yo are reading m lti!le records "or each observation? a.

b.

c.

d.

421. $hich is tr e "or the do ble trailing at sign 3YY4? a. ,t enables the next ,N>A- statement to read "rom the c rrent record across m lti!le iterations o" the (A-A ste!. b. ,t m st be the last item that is s!eci"ied in the ,N>A- statement. c. ,t is released when the in! t !ointer moves !ast the end o" the record. d. All o" the above.

435. A record that is being held by a single trailing at sign 3Y4 is a tomatically released when a. the in! t !ointer moves !ast the end o" the record. b. the next iteration o" the (A-A ste! begins. c. another ,N>A- statement that has a single trailing at sign 3Y4 exec tes. d. another val e is read "rom the observation. 436. $hich SAS !rogram correctly creates a se!arate observation "or each bloc: o" data?

a. b. c. d. e. ". g. h. i. G. :. l. m. n. o. !.

ata !erm.!rod ce< in"ile "r it< in! t ,tem *4. Kariety D *65.< r n< data !erm.!rod ce< in"ile "r it< in! t ,tem *4. Kariety D *65. Y< r n< data !erm.!rod ce< in"ile "r it< in! t ,tem * Kariety D *65. YY< r n< data !erm.!rod ce< in"ile "r it YY< in! t ,tem *4. Kariety D *65.< r n<

432. $hich SAS !rogram segment reads the val es "or ,( and holds the record "or each val e o" S antity, so that three observations are created "or each record?

a. b. c. d. e. ". g. h. i. G. :.

data wor:.sales< in"ile nitsold< in! t ,( *< do wee:;6 to 3< in! t S antity D comma.< o t! t< end< r n< data wor:.sales< in"ile nitsold< in! t ,( * YY<

l. m. n. o. !. E. r. s. t. . v. w. x. y. 9. aa. bb. cc. dd. ee. "".

do wee:;6 to 3< in! t S antity D comma.< o t! t< end< r n< data wor:.sales< in"ile nitsold< in! t ,( * Y< do wee:;6 to 3< in! t S antity D comma.< o t! t< end< r n< data wor:.sales< in"ile nitsold< in! t ,( * Y< do wee:;6 to 3< in! t S antity D comma. Y< o t! t< end< r n<

433. $hich SAS statement re!etitively exec tes several statements when the val e o" an index variable named 'o nt ranges "rom 6 to #5, incremented by #? a. do co nt;6 to #5 by #< b. do while co nt;6 to #5 by #< c. do co nt;6 to #5 P #< d. do while 3co nt;6 to #5 P #4< 434. $hich o!tion below, when sed in a (A-A ste!, writes an observation to the data set a"ter each val e "or Activity has been read? a. b. c. d. e. ". g. h. i. G. :. l. m. n. do choice;6 to 3< in! t Activity D *65. Y< o t! t< end< r n< do choice;6 to 3< in! t Activity D *65. Y< end< o t! t< r n< do choice;6 to 3< in! t Activity D *65. Y< end< r n<

o.

a and b

43#. $hich SAS statement re!etitively exec tes several statements while the val e o" 'holesterol is greater than 255? a. do cholesterol F 255< b. do cholesterol gt 255< c. do while 3cholesterol F 2554< d. do while cholesterol F 255< 43&. $hich choice below is an exam!le o" a S m statement? a. total!ay;6< b. total!ayP6< c. total!ay=6< d. total!ay by 6< 43). $hich !rogram creates the SAS data set >erm.-o!store "rom the raw data "ile shown below?

SAS (ata Set >erm.-o!store Store 6556 6556 6556 6552 6552 6552 6553 6553 a. b. c. d. e. ". g. h. i. G. :. l. m. Sales ))6&3.61 )&054.)# )4304.2) )&&62.13 064#&.34 025&3.1) 0260#.6& )1)42.33 8onth 6 2 3 6 2 3 6 2

data !erm.to!stores< in"ile sales10 missover< in! t Store Sales D comma. Y< do while 3sales ne .4< month P 6< o t! t< in! t sales D comma. Y< end< r n< data !erm.to!stores< in"ile sales10 missover< in! t Store Sales D comma. Y<

n. o. !. E. r. s. t. . v. w. x. y. 9. aa. bb. cc. dd. ee. "". gg. hh. ii. GG. ::. ll. mm. nn. oo.

do while 3sales ne .4< 8onth;5< month P 6< o t! t< in! t sales D comma. Y< end< r n< data !erm.to!stores< in"ile sales10 missover< in! t Store Sales D comma. 8onth Y< do while 3sales ne .4< month P 6< in! t sales D comma. Y< end< o t! t< r n< data !erm.to!stores< in"ile sales10 missover< in! t Store Sales D comma. Y< 8onth;5< do while 3sales ne .4< month P 6< o t! t< in! t sales D comma. Y< end< r n<

430. How many observations are !rod ced by the (A-A ste! that reads this external "ile?

a. b. c. d.

3 # 62 6#

62G. #hen you write a /ATA step to reate one observation per detail re ord you need to a. distinguish between header and detail re ords. b. Beep the header re ord as part of ea h observation until the ne;t header re ord is en ountered . hold the urrent value of ea h re ord type so that the other values in the re ord an be read

d. all of the above. 660. #hi h SAS statement he Bs for the ondition that *e ord eMuals . and e;e utes a single statement to read the values for Amount, a. if re ord! then input 82 Amount omma@.; b. if re ord!U.U then input 82 Amount omma@.; . if re ord!U.U then do input 82 Amount pmma@.; d. if re ord!. then do input 82 Amount omma@.; 661. #hi h is true for the following statements 0P indi ates a header re ord1, :f ode!UPU then do; :f _n_Z1 then output; Total!0; :nput 'ame 4 2320; )nd; a. b. . d. _'_ eMuals the number of times the /ATA step has begun to e;e ute. #hen ode!UPU and _n_ Z 1 are true5 an %&T(&T statement is e;e uted. )a h header re ord auses an observation to be written to the data set. a and b

662. #hat happens when the ondition type!U(U is false, :f type!U(U then input 82 :/ 4=. 8G Address 420.; )lse if type!UKU then input 82 .harge 9.; a. b. . d. The values for :/ and Address are read. The values for harge are read. Type is assigned the value of K. The )>S) statement is e;e uted.

662. #hat happens when last has a value other than Nero, /ata perm.househld 0drop! ode1; :nfile itydata end!last; *etain Address; :nput type 41. 8; :f ode!UAU then do;

:f _n_ Z 1 then output; Total!0; :nput address 4 231@; )nd; )lse if ode!U'U then totalH1; :f last then output; *un; a. b. . d. >ast has a value of 1. The %&T(&T statement writes the last observation to the data set. The urrent value of >ast is written to the data set. a and b.

Anda mungkin juga menyukai