Sep 30, 2011

62

Which one of the following SAS statements renames two variables?


A. set work.dept1
work.dept2(rename = (jcode = jobcode sal = salary));
B. set work.dept1
work.dept2(rename = jcode = jobcode sal = salary);
C. set work.dept1
work.dept2(rename = (jcode jobcode) (sal salary));
D. set work.dept1
work.dept2(rename = (jcode = jobcode) (sal = salary));

61

A raw data file is listed below:


----|----10---|----20---|----30
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37


The following SAS program is submitted using the raw data file as input:



data work.homework;
infile 'file-specification'; input name $ age height; if age LE 10;
run;

How many observations will the WORK.HOMEWORK data set contain?
A. 0
B. 2
C. 3
D. No data set is created as the program fails to execute due to errors.

60

The following SAS program is submitted:


options pageno = 1;
proc print data = sasuser.houses;
run;
proc means data = sasuser.shoes;
run;


The report created by the PRINT procedure step generates 5 pages of output. What is the page number on the first page of the report generated by the MEANS procedure step?

A. 2
B. 6
C. 5
D. 1

59

The following SAS program is submitted and reads 100 records from a raw data file:


data work.total;
infile 'file-specification' end = eof;
input name $ salary;
totsal + salary;
<insert IF statement here>
run;

Which one of the following IF statements writes the last observation to the output data set?
 A. if end = 0;
B. if eof = 0;
 C. if end = 1;
 D. if eof = 1;
 

58

The following SAS DATA step is submitted:


data work.accounting;
set work.department;
length jobcode $ 12;
run;


The WORK.DEPARTMENT SAS data set contains a character variable named JOBCODE with a length of 5.
Which one of the following is the length of the variable JOBCODE in the output data set?
 A. 8
B. 12
C. The length can not be determined as the program fails to execute due to errors.
D. 5

57

The following SAS program is submitted:


data work.totalsales;
set work.monthlysales(keep = year product sales);
retain monthsales {12} ; array monthsales {12} ; do i = 1 to 12; monthsales{i} = sales; end;
cnt + 1;
monthsales{cnt} = sales;
run;


The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.


Which one of the following is the result of the above program?


A. The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.
B. The program fails execution due to data errors.
C. The program fails execution due to syntax errors.
D. The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations.

56

The following SAS program is submitted:


data work.test;
Author = 'Agatha Christie';
First = substr(scan(author,1,' ,'),1,1);
run;

Which one of the following is the length of the variable FIRST in the output data set?
A. 6
B. 200
C. 15
D. 1

55

The following SAS program is submitted:


data _null_;
set old;
put sales1 sales2;
run;


Where is the output written?


A. the raw data file that was opened last
B. the data set mentioned in the DATA statement
C. the SAS log
D. the SAS output window or an output file

54

The contents of the raw data file PRODUCT are listed below:


----|----10---|----20---|----30
24613 $25.31


The following SAS program is submitted:


data inventory;
infile 'product';
input idnum 5. @10 price;
run;


Which one of the following is the value of the PRICE variable?


A. No value is stored as the program fails to execute due to errors.
B. $25.31
C. 25.31
D. . (missing numeric value)

53

The contents of the raw data file AMOUNT are listed below:


----|----10---|----20---|----30
$1,234


The following SAS program is submitted:


data test;
infile 'amount';
input @1 salary 6.;
run;

Which one of the following is the value of the SALARY variable?
 A. 1,234
B. 1234
C. $1,234
D. . (missing numeric value)

52

The following SAS program is submitted:


data work.test;
set work.staff (keep = jansales febsales marsales);
array diff_sales{3} difsales1 - difsales3;
array monthly{3} jansales febsales marsales;
run;

Which one of the following represents the new variables that are created? A. JANSALES, FEBSALES and MARSALES
B. MONTHLY1, MONTHLY2 and MONTHLY3
C. DIFSALES1, DIFSALES2 and DIFSALES3
D. DIFF_SALES1, DIFF_SALES2 and DIFF_SALES3

51

The following SAS program is submitted:


data work.report;
set work.sales_info;
if qtr(sales_date) ge 3;
run;


The SAS data set WORK.SALES_INFO has one observation for each month in the year 2000 and the variable SALES_DATE which contains a SAS date value for each of the twelve months.


How many of the original twelve observations in WORK.SALES_INFO are written to the
WORK.REPORT data set?


A. 3
B. 6
C. 9
D. 2

50

A raw data file is listed below:


----|----10---|----20---|----30
1901 2
1905 1
1910 6
1925 .
1941 1


The following SAS program is submitted and references the raw data file above:


data coins;
infile 'file-specification';
input year quantity;
<insert statement(s) here>
run;


Which one of the following completes the program and produces a non-missing value for the variable TOTQUANTITY in the last observation of the output data set?

A. totquantity + quantity;
B. totquantity = sum(totquantity + quantity);
C. retain totquantity 0;
totquantity = totquantity + quantity;
D. totquantity 0;
sum totquantity;

49

The following SAS program is submitted:


data work.sets;
do until (prod gt 6);
prod + 1;
end;
run;


Which one of the following is the value of the variable PROD in the output data set?


A. 5
B. 8
C. 7
D. 6

48

A SAS program is submitted and the following SAS log is produced:


2 data gt100;
3 set ia.airplanes
4 if mpg gt 100 then output;
22 202
ERROR: File WORK.IF.DATA does not exist. ERROR: File WORK.MPG.DATA does not exist. ERROR: File WORK.GT.DATA does not exist. ERROR: File WORK.THEN.DATA does not exist. ERROR: File WORK.OUTPUT.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 202-322: The option or parameter is not recognized and will be ignored.


5 run;
The IA libref was previously assigned in this SAS session. Which one of the following corrects the errors in the LOG?


A. Delete the word THEN on the IF statement.
B. Add a semicolon at the end of the SET statement.
C. Add an END statement to conclude the IF statement.
 D. Place quotes around the value on the IF statement.

47

The following SAS program is submitted:


proc datasets lib = sasuser; contents data = class varnum; quit;
Which one of the following is the purpose of the VARNUM option? A. to print the total number of variables
B. to print a list of the variables in the order they were created
C. to print a list of the variables in alphabetic order
D. to print a list of variable names

46


Which one of the following SAS system options displays the time on a report? A. DATE
B. TIME
C. TODAY
D. DATETIME

45


The following SAS program is submitted:


data work.empsalary;
set work.people (in = inemp)
work.money (in = insal);
if insal and inemp;
run;


The SAS data set WORK.PEOPLE has 5 observations, and the data set WORK.MONEY has 7 observations. How many observations will the data set WORK.EMPSALARY contain?

A. 12
B. 7
C. 5
D. 0

43

A raw data record is listed below:


----|----10---|----20---|----30
Printing 750

The following SAS program is submitted:


data bonus;
infile 'file-specification';
input dept $ 1 - 11 number 13 - 15;
<insert code here>
run;


Which one of the following SAS statements completes the program and results in a value of
'Printing750' for the DEPARTMENT variable?


A. department = trim(dept) || put(number,3.);
 B. department = dept || input(number,3.);
C. department = input(dept,11.) || input(number,3.);
 D. department = trim(dept) || number;



44

The following SAS program is submitted:


proc format;
value score 1 - 50 = 'Fail'
51 - 100 = 'Pass';
run;
proc report data = work.courses nowd;
column exam;
define exam / display format = score.;
run;


The variable EXAM has a value of 50.5.
 How will the EXAM variable value be displayed in the REPORT procedure output?

A. 50.5
B. . (missing numeric value)
C. Fail
D. Pass