Você está na página 1de 21

1)

The following program is submitted, Data numercards; Infile file-specification; Input @1 patient $1 ! relati"e $ 1#$%# @; If relati"e&children then input @ ' diagnosis $1 ! @; else if relati"e&parents then input @%( doctor $1 ! )linic $ ''$ * @ ' diagnosis $1 ! @; input age; run; +ow man, raw data records are read during each iteration of the data step during e-ecution. /! 0! )! D! 1 % * '

%)

The following program is submitted, Data re"enue; 1et ,ear; 2ar1&md,31,1 ,14#5); run; 6hich one of the following "alues does the "ariable 2/71 contain.

/! 0! )! D! *)

1' 1 11 14#5 181 814#5

The contents of the raw data file 97:D;)T are listed below $$$$<$$$$15$$$<$$$$%5$$$<$$$$*5 %'#1* $% !*1 The following program submitted= Date in"entor,; Infile file-specification; Input idnum ! @15 price; run; 6hich one of the following statement is the "alue of the 97I)> "ariable. /! 0! )! D! % !*1 $% !*1 ! 3?issing numeric "alue) @o "alue is stored as the program fails to e-ecute due to errors!

')

/ program is submitted and the following log is produced; % * ' data gt155; set ia!airplanes if mpg gt 155 then output;

>77:7= Aile 6:7B!IA!D/T/ dose not e-ist >77:7= Aile 6:7B!?9C!D/T/ does not e-ist >77:7= Aile 6:7B!CT!D/T/ does not e-ist >77:7= Aile 6:7B!T+>@!D/T/ does not e-ist >77:7= Aile 6:7B!:;T9;T!D/T/ does not e-ist >77:7 %%$*%% = 1,nta- error, e-pecting one of the following= a name, a Duoted string, 3 , ; >@D, B>E, B>E1, @:01, :9>@, 9:I@T! 7un; The I/ libref was pre"iousl, assigned in this 1/1 session! 6hich one of the following corrects the errors in the F:C. /! 0! ) D ) Delete word T+>@ on the IA statement /dd a semicolon at the end of 1>T statement 9lace Duotes around "alue on IA statement /dd an >@D statement to conclude IA statement!

/ program is submitted and the following log is produced; Data worG!sets; Do until3prod gt #); 9rod H 1; >nd; 7un; 6hich one of the following is the "alue for "ariable 97:D in the output dataset. /!

0! # ) I D ( #) The following program is submitted; Data worG!totalsales3Geep&monthsalesJ1%K); set worG!monthl,sales3Geep&,ear product sales); arra, monthsalesJ1%K; do I&1 to 1%; monthsales3i)&sales; end; 7un; The data set name 6:7B!?:@T+FE1/F>1 has one obser"ation per month for each of fi"e ,ears for a total of #5 obser"ation! 6hich one of the following is the result of the abo"e program. /! 0! ) D I) The program fails e-ecution due to data errors! The program fails e-ecution due to s,nta- errors The program e-ecutes with warning and create the 6:7B!T:T/F1/F>1 dataset The program e-ecutes without warning and create the 6:7B!T:T/F1/F>1 dataset!

The following program is submitted and read 155 records from raw data file = Data worG!total; Infile file$specification end&eof; Input name $ salar, ; Total H salar,; LInsert IA statement hereM

7un; 6hich one of the following IA statement write the last obser"ation to the output dataset. /! 0! ) D () If end&5; If eof&5; If end&1; If eof&1;

The following program is submitted = Data worG!test; Airst&Ipswich, >ngland; )it,Ncountr,&substr3first,1,I)<<, <<>ngland; 7un; 6hich one of the following is the length for "ariable )it,Ncountr, in the output dataset. /! 0! ) D # I 1I %

4)

6hen the following program is submitted, dataset 1/1D/T/!97D1/F>1 contains 555 records= Fibname sasdata 1/1$data$librar,; :ptions obs& 55; 9roc print data& sasdata!prdsales3firstobs&155); :ptions obs&ma-; 9roc means data&sasdata!prdsales3firstobs& 55); 7un;

+ow man, obser"ations are produced b, each proc. /! '55 for proc print ' 55 for proc means 0! '51 for proc print ' 51 for proc means ) '51 for proc print ' 55 for proc means D 55 for proc print 555 for proc means 15) / raw data record is listed as below= $$$$<$$$$15$$$<$$$$%5$$$<$$$$*5 14448158% The following is submitted= Data proOectduration; Infile file$specification; Input date $ 1$15; Linsert statement hereM 7un; 6hich one complete the program abo"e and computes the duration of the proOect in da, as toda,s date. /! 0! ) D duration&toda,3) P put3date, mmdd,,15!); duration&toda,3) P put3date, ,,mmdd15!); duration&toda,3) P input3date, ddmm,,15!); duration&toda,3) P input3date, ,,mmdd15!);

11)

6hich one of the following :D1 statement terminates output being written to an +T?F file. /! 0! ) D >@D Q;IT 1T:9 )F:1>

1%)

The following program is submitted = Data worG!test; title&/ title of Two )ities, )harles R! DicGens; word&scan3title, *, ,); 7un; 6hich one of the following is the "alue of "ariable 6:7D in the output dataset. /! 0! ) D T :f DicGens 3missing character "alue)

1*)

The following program is submitted = 9roc datasets lib&sasuser; )ontents data&class "arnum; Quit; 6hich one of the following is the purpose of the 2/7@;? option . /! to print a list of "ariables names

0! to print the total number of "ariables ) to print a list of "ariables in alphabetical order D to print a list of "ariables in the order the, were created! 1') The following program is submitted = Data worG!Ranuar,; 1et worG!allmonths3Geep&product month numNsold cost); If month&Ran then output worG!Ranuar,; 1ales&costSnumNsold; Beep&product sales; 7un; 6hich "ariables does the dataset 6:7B!Ranuar, contain. /! 0! ) D 1 ) product and sales onl, product, month, numNsold and cost onl, product, sales, month, numNsold, and cost onl, an incomplete output dataset is created due to s,nta- error!

:n which portion3s) of a 1/1 dataset does the 97I@T procedure report. /! 0! ) D the data portion onl, the descriptor portion onl, 0oth portions @either portion

1#)

The content of the raw data file >?9F:E>> are listed below= $$$$<$$$$15$$$<$$$$%5$$$<$$$$*5 ruth *4 11

Oose *% %% 1ue *5 ** Rohn'5 '' The following program is submitted= Data test; Infile >mplo,ee; Input emplo,eeNname $ 1$'; If emplo,eeNname &ruth then input idnum 15 P11; >lse input age I$(; 7un; 6hich one does the "ariable ID@;? contains when the name of the emplo,ee is ruth. /! 0! ) D 1I) 11 %% ** ! 3missing numeric "alue)

The following program is submitted = 9roc report data&worG!houses nowd; )olumn st,le price; 6here price L 155555; Linsert D>AI@> statements hereM run; The output looG liGes= 1t,le price

)ondo 7anch

(5,5 5 I4,* 5 #',555 (#,# 5

6hich one of the following completes the program and generate the output. /! define st,le8displa, width&4; define price8sum format&comma4! width&15; 0! define st,le8width&4; define price8sum format&comm4! width&15; ) define st,le8group width&4; Define price8sum format&comma4! width&15; D define st,le8order width&4; Define price8sum format&comma4! width&15; 1() The following program is submitted = Data worG!new; Fength word $I!; /mount&I; If amount& then word&)/T; >lse if amount&I then word&D:C; >lse word&@oneTTT; /mount& ; run; 6hich one represents the "alues of /?:;@T and 6:7B "ariables. /! /mount word D:C

/! /mount ) D 14) /mount I /mount I

word )/T word D:C word 3missing character "alue)

The following program is submitted = Data test; 1et sasuser!emplo,ees; If % le ,earNser"ice le 15 then amount&1555; >lse if ,earNser"ice gt 15 then amount&%555; >lse amount&5; /mountNperN,ear&,earNser"ice8amount; 7un; 6hich one does the "ariable /mountNperN,ear contains if an emplo,ee has been with the compan, for one ,ear. /! 0! ) D 5 1555 %555 ! 3missing numeric "alue)

%5)

The following program is submitted = Fibname compan, librar,$specification; 9roc sort data&compan,!pa,roll; 0, emplo,eeidnumber; 7un;

6hich one represents how the records are sorted. /! ):?9/@E!9/E7:FF is recreated in sorted order of >?9F:E>ID@;?0>7! 0! ):?9/@E!9/E7:FF is stored in original order, and a new dataset 9/E7:FF is created in sorted order of >?9F:E>ID@;?0>7! ) ):?9/@E!9/E7:FF is stored in original order, and a new dataset ):?9/@E!9/E7:FF1:7T>D is created in sorted order of >?9F:E>ID@;?0>7! D ):?9/@E!9/E7:FF is recreated in sorted order of >?9F:E>ID@;?0>7, and a new dataset 9/E7:FF is created in sorted order of >?9F:E>ID@;?0>7 %1) The following program is submitted = Data sasdata!/tlanta sasdata!boston sasdata!9ortland sasdata!phoeni-; 1et compan,!prdsales; If region&@> then output boston; If region&1> then output /tlanta; If region&16 then output phoeni-; If region&@6 then output 9ortland; 7un; 6hich one of the following is true . /! 0! ) D %%) no librar, references are reDuired! the datasets listed on all the IA statements reDuires a libref! the datasets listed in the last two IA statement reDuires a libref! the datasets listed in the first two IA statement reDuires a libref!

The following program is submitted = Data worG!clients; )alls&#;

Do while 3calls le #); )allsH1; >nd; 7un; 6hich one is the "alue for )/FF1 . /! ' 0! ) # D I %*) The output of 97I@T procedure of dataset 6:7B!F>2>F1 is as follows= :bs 1 % * ' # I name AranG Rohn Rui Rose 0urt Bell, Ruan le"el 1 % % * ' ! 1

The following program is submitted= Data worG!e-pertise; 1et worG!le"els; If le"el&! Then e-pertise&;nGnown; >lse if le"el&1 then e-pertise&Fow; >lse if le"el&% then e-pertise&?edium; >lse e-pertise&+igh;

7un; 6hich one of the following does the "ariable >U9>7TI1> contains. /! 0! ) D %') Fow, ?edium, +igh Fow, ?edium, ;nGnown Fow, ?edium, +igh, ;nGnown Fow, ?edium, +igh, ;nGnown, and 3missing character "alue)

The following program is submitted = Data worG!empsalar,; 1et worG!people3in&inemp) 6orG!mone,3in&insal); If insal and inemp; 7un; 6orG!people has obs, worG!mone, has I obs!

+ow man, obser"ation will the dataset 6:7B!>?91/F/7E contain. /! 5 0! ) I D 1% % ) The following program is submitted = Fibname sasdata library reference; Data test; 1et sasdata!chemist3Geep&OobNcode);

If OobNcode&chem* then description&1enior )hemist; 7un; 2ariable R:0N):D> is a character "ariable with a length of # b,tes! 6hich one is the length of "ariable D>1)7I9TI:@. /! 0! ) D %#) # ( 1' %55

The following program is submitted = Data worG!month; Date&input31%?/7%55*,date4!); 7un; 6hich one represents the t,pe and length of D/T>. /! 0! ) D numeric, ( b,tes numeric, 4 b,tes character, ( b,tes character, 4 b,tes

%I)

The following program is submitted = 9roc sort data&sasuser!houses out&report; 0, st,le; 7un;

In which librar, is the output dataset stored. /! 0! ) D %() worG report houses sasuser

The following program is submitted = Data worG!passengers; If origpassengers&! Then origpassengers&155; Transpassengers&155; :rigpassengers&!; @onpa,ing&15; Total9assengers&:rig9assengers H Transpassengers; 7un; 6hich one is the "alue for T:T/F9/11>@C>71. /! 0! ) D 155 115 %55 ! 3missing numeric "alue)

%4)

The following program is submitted = Data worG!flights; destination&)9+; select3destination); when 3F+7) cit,&Fondon; when 3)9+) cit,&)openhagen;

otherwise cit,&:ther; end; 7un; 6hich one is the "alue for )ITE. /! 0! ) D *5) :ther )openh )openhagen 3missing character "alue)

The following program is submitted= :ptions pageno&1; 9roc print data&sasuser!houses; 7un; 9roc means data&sasuser!shoes; 7un; The report created b, 97I@T procedure generates pages of output!

6hich is the page number on the first page generated b, ?>/@1 procedure. /! 1 0! % ) D # *1) The following program is submitted = 9roc sort data&worG!emplo,ee;

0, descending fname; 9roc sort data&worG!salar,; 0, descending fname; Data worG!empdata; ?erge worG!emplo,ee worG!salar,; 0, fname; 7un; 6hich one e-plains wh, the program failed e-ecution. /! 0! ) D *%) The sort procedure contains s,nta- error! The merge data sets are not permanent 1/1 dataset The datasets were not merged in the order b, which the, were sorted The 7;@ statement were omitted after each of the sort procedure

1/1 dataset >?9F:E>>NI@A: is listed below= ID @umber % '% % '* ' %1 *%(% >-pense 155!55 1*%!1 %*'!1' 111!1%

The following program is submitted= 9roc sort data&emplo,eeNinfo; Linsert 0E statement hereM 7un; 6hich one complete the program and sorts the data seDuentiall, b, descending e-pense "alues within each descending ID number "alue.

/! 0! ) D **)

0, descending Idnumber >-pense; 0, 3Idnumber >-pense) descending; 0, Idnumber descending >-pense descending; 0, descending Idnumber descending >-pense;

The following program is submitted = Data worG!accounting; 1et worG!dept1 worG!dept%; 7un; / character "ariable named R:0):D> e-ists in both datasets! It has a length of 6:7B!D>9T% 6hich one is the length of R:0):D> in the output dataset. /! 0! I ) ( D 1% in 6:7B!D>9T1 and length of I in

*')

The following program is submitted = Data worG!staff; Robcategor,&A/; Roble"el&1; Robcategor,&Oobcategor,<<Ooble"el; 7un; 6hich is the "alue for Robcategor, in the output dataset.

/! 0! ) D * )

A/ A/1 A/ 1 3missing character "alue)

6hich one is true of 7>T/I@ statement in 1/1 data step. /! 0! ) D It can be used to assign an initial "alue to N@N it is onl, "alid in conOunction with a 1;? function It has no effect on "ariables read with the 1>T, ?>7C>, and ;9D/T> statements! It adds the "alue of an e-pression to an accumulate "ariable and ignores the missing "alues

*#)

The following program is submitted = LInsert :D1 statement hereM proc means data&sasuser!shoes; where product in 31andal,1lipper,0oot); 7un; 6hich :D1 statement complete the program and generate an +T?F file. /! 0! ) D :D1 html&sales!html; :D1 file&sales!html; :D1 file html&sales!html; :D1 html file&sales!html;

Você também pode gostar