wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SAS PG2 - Data Transformation

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which function can be used to replace text?

a)

TRIM

b)

INDEX

c)

TRANWRD

d)

PROPCASE

2.

Which of the following is a valid function for finding the average of X1, X2, and X3?

a)

AVERAGE(X1,X2,X3)

b)

MEAN(X1,X2,X3)

c)

AVG(X1,X2,X3)

d)

MU(X1,X2,X3)

3.

What will SAS return for the value of X?

X = MIN(SUM(1,2,3),56/8,N(8));

a)

1

b)

6

c)

8

d)

.

4.

What will be the value of Quarter in the following statement?

Quarter = QTR(MDY(04,05,2063));

a)

1

b)

2

c)

3

d)

4

5.

Which type of DATA step statement can be used to initialize a variable to a specified value?

a)

sum

b)

RETAIN

c)

Both of the above

d)

Neither of the above

6.

Which of the following is considered a sum statement in the DATA step?

a)

X = A + B;

b)

X = SUM(A,B);

c)

A + B;

d)

All of the above

7.

Which WHERE statement using a mnemonic operator is equivalent to the following WHERE statement using a symbolic operator?

WHERE Temp ~= . ;

a)

WHERE Temp IS NOT MISSING ;

b)

WHERE Temp CONTAINS . ;

c)

WHERE Temp IN (.) ;

d)

All of the above

8.

To print only the variables Q1, Q2, and Q3 using PROC PRINT, which VAR statement could you use?

a)

VAR Q1,Q2,Q3;

b)

VAR Q1 Q2 Q3;

c)

VAR (Q1 to Q3);

d)

All of the above

9.

What is true about formats assigned to variables in the DATA step?

a)

They affect the stored values of variables in the data set

b)

They need to be specified for variables during subsequent procedures where you wish to use them

c)

They need to be specified for variables during subsequent DATA steps where you wish to use them

d)

None of the above

10.

For the value 5678 to appear as 5,678.00 in the output which format should be used?

a)

COMMA6.2

b)

COMMA7.2

c)

COMMA7.3

d)

COMMA8.2