.L:55 Quiz 1 St 445, 1995, D. A. Dickey CLOSED BOOK AND NOTE QUIZ. (You may recall that on our system blanks and dots (.) sort low) 1. ( 6 points) A SAS dataset has 18 rows and 3 columns. How many observations ____ and variables _____ does the dataset have? 2. (10 points) Write out the output from the following SAS program (you do not need to worry about observation numbers or titles in this or any other question on this test, just the variable names and their values) 00001 Data Exam1; Input Score; Points=2*score+10; 00002 Cards; 00003 XX 12 20 9 00004 20 35 40 80 00005 30 18 XX XX 00006 ; 00007 proc print; 00008 run; 3. (4 points) In the program of question 2, how many items are in the program data vector? _________ 4. (8 points) Write out the output from this SAS program: 00001 data a; 00002 input y z; 00003 if _n_=1 then t=5; 00004 t=t+1; 00005 cards; 00006 2 5 00007 1 3 00008 6 4 00009 ; 00010 proc print; run; 5. (8 points) Write out the output from this SAS program (hint: the programmer forgot something in line 2). 00001 Data names; 00002 input name weight; 00003 id = (name < 152); 00004 cards; 00005 Jim 154 00006 Bob 133 00007 Phil 165 00008 Doris 112 00009 ; 00010 proc print; 00011 run; 6. (10 points) Write out the output from this SAS program: 00001 Data Char; input a $ b $ 5-7 c $; 00002 * Note: in the first data line 123 is in column 1,2,3 00003 567 is in columns 5,6,7 and 9012 is in columns 00004 9,10,11,12 ; 00005 cards; 00006 123 567 9012 00007 RRR QQQ 00008 RRR ZZZZ 00009 QQQ ZZZZ 00010 RRR ZZZZ 00011 ; 00012 proc print; 00013 run; 7. (10 points) Write the output from this SAS program: 00001 data b; 00002 input AVAR $ 1-4 BVAR $; 00003 cards; 00004 CCB 1 00005 CCCB 2 00006 CC B . 00007 C CC 4 00008 CBB . 00009 proc sort; by avar; 00010 proc print; run; 8. (6 points) In the left side line numbers, insert 3 line number commands which will produce the display on the right side when the ENTER key is struck. Just write over the line numbers as you would type into the computer. 00001 A 00001 G 00002 B 00002 H 00003 C 00003 A 00004 D 00004 B 00005 E 00005 C 00006 F 00006 D 00007 G 00007 E 00008 H 00008 F 9. (6 points) Show how you would go about including a stored file called /ncsu/st445_info/hwk1.sas from the SAS program editor command line. ===>______________________________ 10. (32 points) Here is a SAS program: 00001 data list; input wt1 name $ diet $ wt3 days wt2 ; 00002 cards; 00003 188 Walt McThin 165 50 177 00005 144 Judy Fataway 122 25 135 00004 193 Bubba McThin 164 33 182 00005 ; 00007 proc print; var wt1--wt3; 00008 proc print; var wt1-wt3; 00009 proc print; var diet-character-days; 00010 proc sort; by diet name; 00011 proc print; var days; 00012 run; (A) List the output produced by line 00007. (B) List the output produced by line 00008. (C) List the output produced by line 00009. (D) List the output produced by line 00011.