wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SAS All Units

Total questions: 150

Worksheet time: 1hrs 15mins

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;

51.

Which statement is false concerning the options for the PROC EXPORT statement?

a)

 The DATA= option identifies the input SAS table.

b)

The REPLACE option specifies to overwrite an existing file.

c)

The DBMS= option specifies the database identifier for the type of file being created.

d)

The OUT= option specifies the path and file name of the external data file being created.

52.

Which PROC EXPORT step contains valid syntax?

a)

proc export outfile="c:\temp\cars.txt" tab               data=sashelp.cars replace; run;

b)

proc export data=sashelp.cars dbms=csv               outfile="c:\temp\cars.csv"; run;

c)

proc export data=sashelp.class; dbms=csv;               outfile="c:\temp\cars.csv"; run;

d)

proc export dbms=tab data=sashelp.cars replace=yes               outfile="c:\temp\cars.txt"; run;

53.

What does the following program create?

a)

two SAS tables: sales.q1_2018 and sales.q2_2018

b)

two Excel workbooks: sales.q1_2018 and sales.q2_2018

c)

two worksheets in the Excel workbook: midyear: q1_2018 and q2_2018

d)

two worksheets in the Excel workbook: sales: q1_2018 and q2_2018

54.

Which statement disassociates the sales libref?

libname sales xlsx 'c:\mydata\midyear.xlsx';

a)

libname sales end;

b)

libname sales clear;

c)

libname sales close;

d)

libname sales disassociate;

55.

What type of output file does this program create?

a)

SAS table

b)

delimited file

c)

Microsoft Excel XLS file

d)

Microsoft Excel XLSX file

56.

Which of these programs creates a Microsoft Excel file?

a)

b)

c)

both

d)

neither

57.

Which of the following is not a valid ODS statement?

a)

ods csvall file='c:\temp\myfile.csv';

b)

ods pdf file='c:\temp\myfile.pdf';

c)

ods powerpoint file='c:\temp\myfile.ppt';

d)

ods word file='c:\temp\myfile.doc';

58.

Which statement needs to be added to the end of this program?

a)

ods clear;

b)

ods close;

c)

ods pdf clear;

d)

ods pdf close;

59.

Which statement is false concerning the options for the ODS statement?

a)

The STYLE= option names the desired font.

b)

The FILE= option specifies the output file to create.

c)

The STARTPAGE= option controls the behavior of page breaks.

d)

The PDFTOC= option controls the level of the expansion of the table of contents in PDF documents.

60.

Which statement contains valid syntax for specifying a worksheet name?

a)

ods excel sheet_name='Males';

b)

ods excel (sheet_name='Males');

c)

ods excel option(sheet_name='Males');

d)

ods excel options(sheet_name='Males');

61.

Which of the following SQL steps is written in the correct order?

a)

from ...

select ...

where ...

order by

b)

order by ...

from ..

select ..

where ..

c)

select ...

where ...

order by ...

from ...

d)

select ...

from ...

where ...

order by ...

62.

Which of the following is false regarding the SQL procedure?

a)

Column names are separated with commas.

b)

The procedure ends with a QUIT statement.

c)

Formats can be specified in the FROM clause.

d)

The SELECT and FROM clauses are required in the SELECT statement.

63.

Which syntax is valid for creating a computed column in the SELECT clause?

a)

Ratio = Height/Weight

b)

Ratio as Height/Weight

c)

Height/Weight = Ratio

d)

Height/Weight as Ratio

64.

The SELECT statement creates a report. Which clause can be added before the SELECT clause to create a table?

a)

create work.new =

b)

create work.new table

c)

create table work.new as

d)

create table=work.new as

65.

Which SELECT statement produces the given output?

a)

b)

c)

d)

66.

Which SQL statement can delete tables?

a)

DROP

b)

VOID

c)

DELETE

d)

SELECT

67.

If an inner join is performed on the following tables based on the ID and IDNO columns, how many rows will be in the PROC SQL report?

a)

one

b)

two

c)

three

d)

four

68.

Which statement has the correct syntax for performing an inner join?

a)

b)

c)

d)

69.

Which ON clause has valid qualifying syntax?

a)

b)

c)

d)

70.

Which FROM clause is properly creating aliases?

a)

from empsau=e inner join phonec= p

b)

from empsau(e) inner join phonec(p)

c)

from empsau as e inner join phonec as p

d)

from empsau of e inner join phonec of p

71.

SQL stands for ...

a)

Structured Query Language

b)

Standard Query Language

c)

Statistical Query Language

d)

Snake Quality Lemons

72.

Command in a SQL step that deletes a table

a)

KEEP

b)

DELETE

c)

DROP

d)

RIP

73.

A way to shorten the names of tables in a SQL step ..

a)

CODENAME

b)

NICKNAME

c)

ALIAS

d)

LIBNAME

74.

"desc" is used after the column name in an "order by" statement to sort by descending order.

a)

True

b)

False

75.

You need commas in the "select" statement of a SQL step to separate column names

a)

True

b)

False

76.

Which of the following correctly creates a new column in a "select" statement inside a SQL step

a)

newColumn = oldColumn + 2

b)

oldColumn + 2 as newColumn

c)

newColumn as oldColumn + 2

d)

oldColumn + 2 = newColumn

77.

Which of the following statements drops a table in a SQL step ...

a)

drop table work.myclass

b)

delete work.myclass

c)

delete table work.myclass

d)

remove table work.myclass

78.

Which of the following correctly sets aliases?

a)

from table1 alias a inner join table2 alias b

b)

from table1(a) inner join table2(b)

c)

from table1[a] inner join table2[b]

d)

from table1 as a inner join table2 as b

79.

Which of the following "on" statements will join data where the price columns are equal?

a)

on table1.price > table2.price

b)

on table1.price = table2.price

c)

on table1.price == table2.price

d)

on price = price

80.

PROC SQL steps must end with a QUIT statement

a)

True

b)

False

81.

Which statement is false concerning the compilation phase of the DATA step?

a)

Initial values are assigned to the columns.

b)

The program data vector (PDV) is created.

c)

The DATA step is checked for syntax errors.

d)

The descriptor portion of the output table is created.

82.

Which statement is not a compile-time-only statement?

a)

KEEP

b)

LENGTH

c)

SET

d)

WHERE

83.

Which statement is true concerning the execution phase of the DATA step?

a)

Data is processed in the program data vector (PDV).

b)

An implied OUTPUT occurs at the top of the DATA step.

c)

An implied REINITIALIZE occurs at the bottom of the DATA step.

d)

Columns read from the input table are set to missing when SAS returns to the top of the DATA step.

84.

The DATA step debugger in SAS Enterprise Guide can be used with DATA and PROC steps.

a)

True

b)

False

85.

Which PUTLOG statements create the following results in the SAS log?

a)

putlog all; putlog Ratio;

b)

putlog all; putlog Ratio=;

c)

putlog all; putlog Ratio;

d)

putlog all; putlog Ratio=;

86.

How many rows and columns are in the output table ShippingZones given the following information?

a)

5 rows and 3 columns

b)

5 rows and 4 columns

c)

10 rows and 3 columns

d)

10 rows and 4 columns

87.

The sashelp.cars table contains 428 rows: 123 rows with Origin equal to Europe and 305 rows with Origin equal to other values. How many rows will be in the Other table?

a)

0

b)

123

c)

305

d)

428

88.

Which statement is false?

a)

The KEEP statement names the columns to include from the input table.

b)

The DROP statement names the columns to exclude from the output table.

c)

The KEEP= option in the DATA statement names the columns to include in the output table.

d)

The DROP= option in the SET statement names the columns to exclude from being read into the PDV.

89.

Which columns are in the final table work.boots?

a)

Subsidiary

b)

Subsidiary and Total

c)

Product and Subsidiary

d)

Product, Subsidiary, Sales, and Inventory

90.

What is the result of running the following DATA step?

a)

The step produces work.boots with three columns.

b)

The step produces work.boots with four columns.

c)

The step produces an error due to invalid syntax for the KEEP= option.

d)

The step produces an error because the Sales column is not read in from the sashelp.shoes table.

91.

Which statement contains valid syntax for the RETAIN statement?

a)

retain Year 2018;

b)

retain Year*2018;

c)

retain Year=2018;

d)

retain Year{2018};

92.

Which statement is false concerning the sum statement?

a)

The sum statement ignores missing values.

b)

 The sum statement initially sets the accumulator column to missing.

c)

The sum statements adds a numeric value to an accumulator column.

d)

The sum statement automatically retains the value of the accumulating column.

93.

What is the value of Count at the end of the third DATA step iteration?

a)

. (missing)

b)

60

c)

130

d)

160

94.

What is the value of Count at the end of the third DATA step iteration?

a)

. (missing)

b)

20

c)

30

d)

70

95.

Which step executes successfully without an error, given the input table sashelp.class?

a)

b)

c)

d)

96.

Which statement is true given the following program?

a)

The PDV contains a temporary variable named First.Name.

b)

The output table work.student contains a column named Last.Name.

c)

The DATA step sorts the input table by the column Name.

d)

An error is produced because the BY statement is not permitted in the DATA step.

97.

What are the correct values for First.Name and Last.Name if the value of Name appears only once in the input table?

a)

First.Name=0 and Last.Name=0

b)

First.Name=1 and Last.Name=1

c)

First.Name=1 and Last.Name=0

d)

First.Name=0 and Last.Name=1

98.

Which DATA step statement indicates to continue processing the last row of a BY group?

a)

if First.JobTitle;

b)

if Last.JobTitle;

c)

where First.JobTitle=1;

d)

where Last.JobTitle=1;

99.

Which statement needs to be added to the DATA step to reset the value of Total for each new BY group?

a)

Total=0;

b)

if Last.Region=0 then Total=0;

c)

if First.Region=0 then Total=0;

d)

if First.Region=1 then Total=0;

100.

What are the values for First.City and Last.City for the third row of the input table given the following information?

a)

First.City=0 and Last.City=0

b)

First.City=1 and Last.City=0

c)

First.City=0 and Last.City=1

d)

First.City=1 and Last.City=1

101.

Functions and CALL routines both return a value that must be used in an

assignment statement or expression.

a)

True

b)

False

102.

Which function calculates the average of the columns Week1, Week2,

Week3, and Week4?

a)

mean(Week1, Week4)

b)

mean(Week1-Week4)

c)

mean(of Week1, Week4)

d)

mean(of Week1-Week4)

103.

Which expression rounds each value of Sales to the nearest hundredth

(or two decimal places)?

a)

round(Sales)

b)

round(Sales, 2)

c)

round(Sales, .01)

d)

round(Sales, dollar10.2)

104.

Which function could be used to remove the non-numeric symbols in

Phone?

a)

COMPRESS

b)

COMPBL

c)

SCAN

d)

FIND

105.

Which statement reads CityCountry and correctly assigns a value to

Country?

a)

Country=scan(CityCountry, 2);

b)

Country=scan(CityCountry, -1);

c)

Country=scan(CityCountry, 2, ',');

d)

Country=scan(CityCountry, 2, ', ');

106.

Which expression creates CityCountry?

a)

cat(City, ", ", Country)

b)

cats(", ", City, Country)

c)

catx(City, ", ", Country)

d)

catx(", ", City, Country)

107.

How many rows are written to output based on the following statement?

a)

0

b)

1

c)

3

d)

5

108.

Which of the following functions can convert the values of the numeric

variable Level to character values?

a)

put(Level, 3.)

b)

put(3., Level)

c)

input(3., Level)

d)

input(Level, 3.)

109.

Which of the following functions converts the character values of Base to

numeric values?

a)

put(comma10.2, Base)

b)

put(Base, comma10.2)

c)

input(Base, comma10.2)

d)

input(comma10.2, Base)

110.

Which step is not required when converting a character column named

Date to a numeric SAS date column with the same name?

a)

Rename the Date column to a new name, such as CharDate.

b)

Use the INPUT function to read the renamed CharDate character

column and create a numeric column named Date.

c)

Specify an appropriate informat in the INPUT function.

d)

Format the new numeric Date column.

111.

Which of the following contains valid syntax?

a)

value grades 'A'='Excellent' 'B'='Good';

b)

value qtrfmt 1,2,3='First' 4,5,6='Second';

c)

value $grades. 'A'='Excellent' 'B'='Good';

d)

value qtrfmt '1'-'3'='First' '4'-'6'='Second';

112.

What is the formatted value for the value of 100 given the following step?

a)

low

b)

medium

c)

high

d)

out of range

113.

In the FORMAT procedure, you specify the name of the format and the name of the column that will use the custom format.

a)

True

b)

False

114.

What is the correct formatted output given the following PROC FORMAT step and the input table?

a)

b)

c)

d)

115.

Which of the following does not have proper syntax for specifying a range in the VALUE statement?

a)

500>-700

b)

500-<700

c)

'A'-'C'

d)

'Horse'-'Mouse'

116.

Which statement is true concerning options for the FORMAT procedure?

a)

The FMTLIB option goes in the SELECT statement.

b)

The CNTLIN= option goes in the VALUE statement.

c)

The FMTLIB option specifies the library to store the format.

d)

The CNTLIN= option specifies a table from which formats are built.

117.

Which columns are required in an input table to create a format based on numeric ranges?

a)

FMTNAME, START, and LABEL

b)

FORMAT, START, END, and NAME

c)

FMTNAME, START, END, and LABEL

d)

FORMAT, START, LAST, NAME, and TYPE

118.

Which option in the PROC FORMAT statement specifies a library to store a custom format?

a)

CATALOG=

b)

FMTLIB=

c)

LIBRARY=

d)

STORE=

119.

What is the default search order that is used to locate formats?

a)

LIBRARY.FORMATS > WORK.FORMATS

b)

SASHELP.FORMATS > LIBRARY.FORMATS

c)

SASHELP.FORMATS > WORK.FORMATS

d)

WORK.FORMATS > LIBRARY.FORMATS

120.

Which of the following contains valid syntax for the FMTSEARCH= option?

a)

options fmtsearch=sashelp;

b)

options fmtsearch=sashelp.formats;

c)

options fmtsearch=(sashelp sashelp.fmts);

d)

options fmtsearch=[sashelp.fmts sashelp];

121.

Which statement is true concerning concatenating tables?

a)

All tables must have the same number of columns.

b)

Columns in all tables must have matching names and lengths.

c)

Tables must be in the same library.

d)

Missing values are generated for columns that exist in one input table and not in another.

122.

Which statement renames the existing column Location in work.travel as Destination?

a)

set vacations(rename=(Location=Destination)) travel;

b)

set vacations travel(rename=(Destination=Location));

c)

set vacations travel(rename=(Location=Destination));

d)

set vacations travel(rename(Destination=Location));

123.

Which statement is true concerning merging with matching rows?

a)

The MERGE statement must refer to temporary input tables.

b)

The columns in the BY statement can be in only one of the tables.

c)

Only two input tables can be specified in the MERGE statement.

d)

The input tables must be sorted by the columns in the BY statement.

124.

How many rows are in the both output table given the following input tables and code?

a)

two

b)

three

c)

four

d)

five

e)

seven

125.

How many rows are in the empsauc output table given the following input tables and code?

a)

two

b)

three

c)

four

d)

five

e)

six

126.

What is the result of the following step?

a)

 The table combine is created with four columns and five rows.

b)

The step fails because the BY column ID is not properly sorted.

c)

The step fails because Units is in both tables and not the BY column.

d)

The step fails because of duplicate ID values within the donors1 table.

127.

Which statement best describes the rows in the output table?

a)

all the matching rows from both managers and staff

b)

only the rows from managers that have no match in staff

c)

only the rows from staff that have no match in managers

d)

all the matching and nonmatching rows from both managers and staff

128.

What are the values of C and A during the third iteration of the DATA step?

a)

C=0 and A=0

b)

C=1 and A=0

c)

C=0 and A=1

d)

C=1 and A=1

129.

What is the value of Location in the output table?

a)

Italy

b)

France

c)

Belgium

d)

France Belgium Italy

e)

Italy Belgium France

130.

A single DATA step can be used to merge the following three tables:

a)

True

b)

False

131.

Which output table does the following step produce?

a)

b)

c)

d)

132.

Which statement is true regarding the iterative DO loop?

a)

The start and stop values can be character or numeric values.

b)

If an increment value is not specified, the default increment is 0.

c)

The index column is incremented at the bottom of each DO loop.

d)

The index column is not in the final table unless specifically kept.

133.

How many rows are in the savings output table given the following input table and code? Note: Amount is a numeric column.

a)

1

b)

4

c)

5

d)

20

134.

What is the final value of Year given the following step?

a)

. (missing)

b)

2010

c)

2019

d)

2020

135.

Which of the following statements contains valid syntax?

a)

do 1 to 10 by 2;

b)

do while (Year>2025);

c)

do until Earnings<=100000;

d)

do date='01JAN2019' to '31JAN2019';

136.

How many rows are in the bikeinfo2 output table given the following input table and code?

a)

2

b)

3

c)

6

d)

12

e)

24

137.

What is the value of x at the completion of the DATA step?

a)

. (missing)

b)

13

c)

15

d)

16

138.

Which statement is false?

a)

The DO UNTIL loop executes until a condition is true.

b)

The DO WHILE loop always executes at least one time.

c)

The DO WHILE loop checks the condition at the top of the loop.

d)

The DO UNTIL loop checks the condition at the bottom of the loop.

139.

Which of the following statements contains valid syntax?

a)

do Age=10 to 14 and while (Weight<150);

b)

do week=1 to 52 do until (Mileage ge 2750);

c)

do Increase=5 to 10 while (temperature lt 102);

d)

do Year=2018 to 2028 or until (Earnings<=100000);

140.

Which output table does the following step produce?

a)

b)

c)

d)

141.

Which is the better description for the following table?

a)

wide table

b)

narrow table

142.

When using the DATA step to go from a wide table to a narrow table, which statement is needed for creating multiple rows from a single row?

a)

WIDE

b)

NARROW

c)

RETAIN

d)

OUTPUT

143.

How many rows will be in the final table if work.airwide contains three rows?

a)

3

b)

6

c)

9

d)

12

144.

When using the DATA step to go from a narrow table to a wide table, the KEEP statement is needed to hold values in the PDV across multiple iterations of the DATA step.

a)

True

b)

False

145.

Which statement needs to be added to the DATA step to include only the last row per value of Year in the output table?

a)

output;

b)

if Last then output;

c)

if Last.Year=1 then output;

d)

if Last.Year=0 then output;

146.

Which statement is false concerning the TRANSPOSE procedure?

a)

Columns are transposed into rows.

b)

By default, numeric columns are transposed.

c)

Use a BY statement to sort the data while transposing.

d)

Use a VAR statement to specify the character and numeric columns to transpose.

147.

Which statements are needed in a PROC TRANSPOSE step for the following example (narrow to wide)?

a)

b)

c)

d)

148.

Which statement or statements are needed in a PROC TRANSPOSE step for the following example (wide to narrow)?

a)

by Day;

b)

var Breakfast Lunch Dinner;

c)

id Day;

d)

id Day; var Breakfast Lunch Dinner;

149.

Which option is needed in the PROC TRANSPOSE statement to rename the NAME column as shown in the output table?

a)

name=

b)

name=Meal

c)

prefix=Meal

d)

rename=Meal

150.

Which option is needed in the PROC TRANSPOSE statement to rename the COL columns as shown in the output table?

a)

out=meals2(COL1=Day7 COL2=Day1)

b)

out=meals2(name=(COL1=Day7 COL2=Day1))

c)

out=meals2(rename=(COL1=Day7 COL2=Day1))

d)

out=meals2(prefix=(COL1=Day7 COL2=Day1))