wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SAS Units 1-5

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

How many steps does this program contain?

a)

one

b)

two

c)

four

d)

eight

2.

Running a SAS program can create which of the following?

a)

log

b)

output data

c)

results

d)

all of the above

3.

Which of the following is a SAS syntax requirement?

a)

Begin each statement in column one.

b)

Begin each statement in column one.

c)

Begin each statement in column one.

d)

End each statement with a semicolon.

4.

How many statements does this program contain?

a)

five

b)

six

c)

seven

d)

eight

5.

Which of the following steps is typically used to generate reports and graphs?

a)

DATA

b)

PROC

c)

REPORT

d)

RUN

6.

Does this comment contain syntax errors?

a)

No. The comment is correctly specified.

b)

Yes. Every comment line must end with a semicolon.

c)

Yes. The comment is on more than one line.

d)

Yes. There is a semicolon in the middle of the comment.

7.

What result would you expect from submitting this step?

a)

a report of the work.newsalesemPs data set

b)

an error message in the log

c)

the creation of a table named work.newsalesemps

8.

What happens if you submit the following program?

a)

SAS does not execute the step.

b)

SAS assumes that PROC is misspelled and executes the step.

9.

This program contains a syntax error because National is in different cases.

a)

True

b)

False

10.

Which of the following is not a SAS programming interface?

a)

SAS Enterprise Guide

b)

SAS Manager

c)

SAS Studio

d)

SAS windowing environment

11.

In this PROC CONTENTS output, what is the default length of the Birth_Date column?

a)

4 bytes

b)

8 bytes

c)

32,767 bytes

d)

It does not have a default length.

12.

Which LIBNAME statement has the correct syntax?

a)

libname reports "filepath/workshop";

b)

libname orion filepath/workshop;

c)

libname 3456a "filepath/workshop";

13.

Which of the following tables is available at the beginning of a new SAS session?

a)

sales

b)

work.newsalesemps

c)

sashelp.class

14.

In this table, what type of column is Em ployee_ID?

a)

character

b)

numeric

c)

temporary

d)

missing

15.

Which statement about SAS dates is false?

a)

A SAS date is one of three of SAS column types: numeric, character, and date.

b)

SAS dates represent the number of days from January 1, 1960.

c)

SAS date values can be positive or negative.

d)

SAS date values can be used in calculations.

16.

Which LIBNAME statement has the correct syntax for reading a Microsoft Excel file?

a)

libname excel "filepath/myexcelfile";

b)

libname mydata xlsx "filepath/myexcelfile";

c)

libname mydata xlsx "filepath/field_data.xlsx";

17.

Which library name (libref) is valid?

a)

2010Car

b)

car/2010

c)

car2010

d)

cars_2010

18.

To disassociate a libref that you previously assigned, you can use the UNASSIGN option in the LIBNAME statement.

a)

True

b)

False

19.

What does this code do?

a)

It creates a SAS table named Bi rd817 in the Work library from the CSV file bird_count and replaces Bird817 whenever the CSV file is updated.

b)

It creates a SAS table named Bird817 in the Work library from the CSV file bird_count.

c)

It uses the CSV engine to directly read the data file bird_count.csv.

20.

In which portion of a SAS table are the following found?

• name of the table

• type of the column Salary

• creation date of the table

a)

descriptor portion

b)

data portion

21.

Which of the following is a valid name for a character format?

a)

country

b)

$ctry

c)

$country.

d)

_country

22.

Which of the following FORMAT statements was used to create this output?

a)

format Order_Date date9. Delivery_Date mmddyy8.;

b)

format Order_Date date7. Delivery_Date mmddyy8.;

c)

format Order_Date ddmmmyy. Delivery_Date mmddyy8.;

d)

format Order_Date monyy7. Delivery_Date mmddyy8.;

23.

The format name must include a period delimiter in the FORMAT statement.

a)

True

b)

False

24.

Which row or rows are selected by the following WHERE statement?

a)

row 1

b)

row 2

c)

row 3

d)

rows 1 and 2

e)

all rows

25.

Which statement about this PROC SORT step is true?

a)

The sorted table overwrites the input table.

b)

The rows are sorted by Salary in descending order, and then by Manager_ID in descending order.

c)

A semicolon should not appear after the input table name.

d)

The sorted table contains only the columns specified in the BY statement.

26.

Which of the following statements selects from a table only those rows where the value of the Style column is RANCH, SPLIT, or TWOSTORY?

a)

where Style='RANCH' or 'SPLIT' or 'TWOSTORY';

b)

where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY';

c)

where Style in (RANCH, SPLIT, TWOSTORY);

d)

where Style in ('RANCH', 'SPLIT', 'TWOSTORY');

27.

Which of the following statements selects rows in which Amount is less than or equal to $5,000 or Rate equals 0.095?

a)

where amount <= 5000 or rate=0.095;

b)

where amount le 5000 or rate=0.095;

c)

where amount <= 5000 or rate eq 0.095;

d)

all of the above

28.

Which statement creates the macro variable flower and assigns the value Plumeria?

a)

%let flower=Plumeria;

b)

%let flower="Plumeria";

c)

%let &flower=Plumeria;

d)

%let &flower="Plumeria";

29.

Which statement in a PROC MEANS step enables you to specify the numeric columns to analyze?

a)

TABLES

b)

VARS

c)

VAR

d)

KEEP=

30.

If you have a table that includes flower sales to all your retail outlets. You want to see the distinct values of Flower_Type with a count and percentage for each. Which procedure would you use?

a)

PRINT

b)

MEANS

c)

UNIVARIATE

d)

FREQ

31.

In which phase does the DATA step check for syntax errors?

a)

compilation

b)

execution

32.

What statement is used to read a SAS data set in a DATA step?

a)

DATA statement

b)

WHERE statement

c)

SET statement

d)

assignment statement

33.

To process an Excel file with the DATA step, you must first create a copy of the data as a SAS table.

a)

True

b)

False

34.

What is the name of the output data set in the program below?

a)

work.us

b)

orion.sales

c)

Country

d)

sales

35.

The data set orion.sales contains nine columns. Given this DATA step, how many columns does work.comp contain?

a)

four

b)

nine

c)

five

36.

Given the assignment statement below, what is the value of AvgExp for the observation that is shown?

a)

6

b)

8

c)

. (missing value)

d)

The statement generates a syntax error.

37.

Which of the following SAS functions returns a number from 1 to 12?

a)

YEAR(SAS-date-value)

b)

MONTH(SAS-date-value)

c)

WEEKDAY(SAS-date-value)

d)

none of the above

38.

In the program below, what is the value of Credit if Country is 'au'?

a)

300

b)

500

c)

0

d)

missing

39.

What is the length of the Car_Type column created in this program?

a)

6

b)

7

c)

8

40.

Use a DO group in a DATA step when you want to execute multiple statements for a true IF-THEN expression.

a)

True

b)

False

41.

If you run this program, which title or titles appear in the final PROC PRINT results?

a)

The Top Line

b)

The Top Line

The Next Line

c)

The Top Line

The Second Line

d)

The Top Line

The First Line

The Next Line

42.

Which statement substitutes the value of the macro variable Year in the footnote?

a)

footnote 'year Sales' ;

b)

footnote '&year Sales' ;

c)

footnote "%year Sales" ;

d)

footnote "&year Sales" ;

43.

Which statement is true based on the given program?

a)

The column BatAvg will have a permanent label in the sashelp.baseballtable.

b)

The label for BatAvg will appear in the PRINT report.

c)

The label for BatAvg will appear in the MEANS report.

d)

The label for BatAvg will appear in both reports.

44.

Which statement is true regarding a BY statement in a reporting procedure such as PROC PRINT?

a)

The BY statement is responsible for sorting the table.

b)

Only one column can be specified in the BY statement.

c)

The BY statement groups the report by the specified columns.

d)

The BY statement must be the first statement after the PROC statement

45.

Which statement is false concerning the FREQ procedure?

a)

The NOPROCTITLE option can be placed in the PROC FREQ statement to remove the procedure title of The FREQ Procedure.

b)

The ORDER=FREQ option can be placed in the PROC FREQ statement to display the column values in descending frequency count order.

c)

The PLOTS= option can be placed in the TABLES statement after the forward slash to create bar charts based on counts or percentages.

d)

The OUT= option can be placed in the TABLES statement after the forward slash to create a table containing counts and percentages.

46.

Which PROC FREQ step creates the results shown here?

a)

a

b)

b

c)

c

d)

d

47.

Which report is created from the following PROC FREQ step?

a)

a

b)

b

c)

c

d)

d

48.

Which statement is true concerning the MEANS procedure?

a)

The VAR statement is required and identifies the analysis columns.

b)

The WAYS statement specifies the number of ways to make unique combinations of class columns.

c)

The MAXDEC= option is used in the VAR statement to specify the number of decimal places for the statistics.

d)

The COUNT and FREQ columns are automatically included in the output summary table that is produced by the OUT= option of the OUTPUT statement.

49.

The input table must be pre-sorted by the columns listed in the CLASS statement of a PROC MEANS step.

a)

True

b)

False

50.

Which statement from PROC MEANS contains valid syntax for creating a summary output table?

a)

out=work.summary mean;

b)

out work.summary mean(Weight)=TotW;

c)

output out work.summary Weight=TotW;

d)

output out=work.summary mean(Weight)=TotW;