SAS Base (47)

The following output is created by the FREQUENCY procedure:

Frequency
Percent
Row Pct
Col Pct
Table of region by product
region product
corn cotton oranges Total
EAST
2
22.22
50.00
50.00
1
11.11
25.00
33.33
1
11.11
25.00
50.00
4
44.44
SOUTH
2
22.22
40.00
50.00
2
22.22
40.00
66.67
1
11.11
20.00
50.00
5
55.56
Total
4
44.44
3
33.33
2
22.22
9
100.00

Which TABLES option(s) would be used to eliminate the

row and column counts and just see the frequencies and percents?

A. norowcount nocolcount
B. freq percent
C. norow nocol
D. nocounts

Check Answer

SAS Base (46)

Given the SAS data set WORK.ONE:

Obs Revenue2008 Revenue2009 Revenue2010
1 1.2 1.6 2

The following SAS program is submitted:

data WORK.TWO;
set WORK.ONE;
Total=mean(of Rev:);
run;

What value will SAS assign to Total?

A. 3
B. 1.6
C. 4.8
D. The program fails to execute due to errors.

Check Answer

SAS Base (45)

The following SAS program is submitted:

ods csvall file=’c:test.csv’;
proc print data=WORK.ONE;
var Name Score Grade;
by IdNumber;
run;
ods csvall close;

What is produced as output?

A. A file named test.csv that can only be opened in Excel.
B. A text file named test.csv that can be opened in Excel or in any text editor.
C. A text file named test.csv that can only be opened in a text editor.
D. A file named test.csv that can only be opened by SAS.

Check Answer

SAS Base (44)

The following SAS program is submitted:

data ONE TWO SASUSER.TWO;
set SASUSER.ONE;
run;

Assuming that SASUSER.ONE exists, how many temporary and permanent SAS data sets are created?

A. 2 temporary and 1 permanent SAS data sets are created
B. 3 temporary and 2 permanent SAS data sets are created
C. 2 temporary and 2 permanent SAS data sets are created
D. there is an error and no new data sets are created

Check Answer

SAS Base (43)

Given the SAS data set WORK.ORDERS:

order_id customer shipped
9341 Josh Martin 02FEB2009
9874 Rachel Lords 14MAR2009
10233 Takashi Sato 07JUL2009

The variable order_id is numeric; customer is character; and shipped is numeric, contains a SAS date value,and is shown with the DATE9. format.

A programmer would like to create a new variable, ship_note,that shows a character value with the order_id,shipped date, and customer name.

For example, given the first observation ship_note would have the value “Order 9341 shipped on 02FEB2009 to Josh Martin”.

Which of the following statement will correctly create the value and assign it to ship_note?

A. ship_note=catx(‘ ‘,’Order’,order_id,’shipped on’,input(shipped,date9.),’to’,customer);
B. ship_note=catx(‘ ‘,’Order’,order_id,’shipped on’,char(shipped,date9.),’to’,customer);
C. ship_note=catx(‘ ‘,’Order’,order_id,’shipped on’,tranwrd(shipped,date9.),’to’,customer);
D. ship_note=catx(‘ ‘,’Order’,order_id,’shipped on’,put(shipped,date9.),’to’,customer);

Check Answer

SAS Base (42)

The following SAS program is submitted:

data WORK.ONE;
Text=’Australia, US, Denmark’;
Pos=find(Text,’US’,’i’,5);
run;

What value will SAS assign to Pos?

A. 0
B. 1
C. 2
D. 12

Check Answer

SAS Base (41)

Given the raw data record in the file phone.txt:

----|----10---|----20---|----30---|
Stevens James SALES 304-923-3721 14

The following SAS program is submitted:

data WORK.PHONES;
infile ‘phone.txt’;
input EmpLName $ EmpFName $ Dept $ Phone $ Extension;
<_insert_code_>
run;

Which SAS statement completes the program and results in a value of “James Stevens” for the variable FullName?

A. FullName=CATX(‘ ‘,EmpFName,EmpLName);
B. FullName=CAT(‘ ‘,EmpFName,EmpLName);
C. FullName=EmpFName||EmpLName;
D. FullName=EmpFName + EmpLName;

Check Answer

SAS Base (40)

The following SAS program is submitted:

data WORK.PRODUCTS;
Prod=1;
do while(Prod LE 6);
Prod + 1;
end;
run;

What is the value of the variable Prod in the output data set?

A. 6
B. 7
C. 8
D. . (missing numeric)

Check Answer

SAS Base (39)

The following SAS program is submitted:

data WORK.AUTHORS;
array Favorites{3} $ 8 (‘Shakespeare’,’Hemingway’,’McCaffrey’);
run;

What is the value of the second variable in the dataset WORK.AUTHORS?
A. Hemingway
B. Hemingwa
C. ‘ ‘ (a missing value)
D. The program contains errors. No variables are created.

Check Answer

SAS Base (38)

Given the SAS data set WORK.ONE:

X Y Z
1 A 27
1 A 33
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91

The following SAS program is submitted:

data WORK.TWO;
set WORK.ONE;
by X Y;
if First.Y;
run;
proc print data=WORK.TWO noobs;
run;

Which report is produced?

A.

X Y Z
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91

B.

X Y Z
1 A 27
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91

C.

X Y Z
1 A 33
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91

D. The PRINT procedure fails because the data set WORK.TWO is not created in the DATA step.

Check Answer