NEW
Font size
WorksheetsSAS Units 1-5
Total questions: 50
Worksheet time: 25mins
How many steps does this program contain?
one
two
four
eight
Running a SAS program can create which of the following?
log
output data
results
all of the above
Which of the following is a SAS syntax requirement?
Begin each statement in column one.
Begin each statement in column one.
Begin each statement in column one.
End each statement with a semicolon.
How many statements does this program contain?
five
six
seven
eight
Which of the following steps is typically used to generate reports and graphs?
DATA
PROC
REPORT
RUN
Does this comment contain syntax errors?
No. The comment is correctly specified.
Yes. Every comment line must end with a semicolon.
Yes. The comment is on more than one line.
Yes. There is a semicolon in the middle of the comment.
What result would you expect from submitting this step?
a report of the work.newsalesemPs data set
an error message in the log
the creation of a table named work.newsalesemps
What happens if you submit the following program?
SAS does not execute the step.
SAS assumes that PROC is misspelled and executes the step.
This program contains a syntax error because National is in different cases.
True
False
Which of the following is not a SAS programming interface?
SAS Enterprise Guide
SAS Manager
SAS Studio
SAS windowing environment
In this PROC CONTENTS output, what is the default length of the Birth_Date column?
4 bytes
8 bytes
32,767 bytes
It does not have a default length.
Which LIBNAME statement has the correct syntax?
libname reports "filepath/workshop";
libname orion filepath/workshop;
libname 3456a "filepath/workshop";
Which of the following tables is available at the beginning of a new SAS session?
sales
work.newsalesemps
sashelp.class
In this table, what type of column is Em ployee_ID?
character
numeric
temporary
missing
Which statement about SAS dates is false?
A SAS date is one of three of SAS column types: numeric, character, and date.
SAS dates represent the number of days from January 1, 1960.
SAS date values can be positive or negative.
SAS date values can be used in calculations.
Which LIBNAME statement has the correct syntax for reading a Microsoft Excel file?
libname excel "filepath/myexcelfile";
libname mydata xlsx "filepath/myexcelfile";
libname mydata xlsx "filepath/field_data.xlsx";
Which library name (libref) is valid?
2010Car
car/2010
car2010
cars_2010
To disassociate a libref that you previously assigned, you can use the UNASSIGN option in the LIBNAME statement.
True
False
What does this code do?
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.
It creates a SAS table named Bird817 in the Work library from the CSV file bird_count.
It uses the CSV engine to directly read the data file bird_count.csv.
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
descriptor portion
data portion
Which of the following is a valid name for a character format?
country
$ctry
$country.
_country
Which of the following FORMAT statements was used to create this output?
format Order_Date date9. Delivery_Date mmddyy8.;
format Order_Date date7. Delivery_Date mmddyy8.;
format Order_Date ddmmmyy. Delivery_Date mmddyy8.;
format Order_Date monyy7. Delivery_Date mmddyy8.;
The format name must include a period delimiter in the FORMAT statement.
True
False
Which row or rows are selected by the following WHERE statement?
row 1
row 2
row 3
rows 1 and 2
all rows
Which statement about this PROC SORT step is true?
The sorted table overwrites the input table.
The rows are sorted by Salary in descending order, and then by Manager_ID in descending order.
A semicolon should not appear after the input table name.
The sorted table contains only the columns specified in the BY statement.
Which of the following statements selects from a table only those rows where the value of the Style column is RANCH, SPLIT, or TWOSTORY?
where Style='RANCH' or 'SPLIT' or 'TWOSTORY';
where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
where Style in (RANCH, SPLIT, TWOSTORY);
where Style in ('RANCH', 'SPLIT', 'TWOSTORY');
Which of the following statements selects rows in which Amount is less than or equal to $5,000 or Rate equals 0.095?
where amount <= 5000 or rate=0.095;
where amount le 5000 or rate=0.095;
where amount <= 5000 or rate eq 0.095;
all of the above
Which statement creates the macro variable flower and assigns the value Plumeria?
%let flower=Plumeria;
%let flower="Plumeria";
%let &flower=Plumeria;
%let &flower="Plumeria";
Which statement in a PROC MEANS step enables you to specify the numeric columns to analyze?
TABLES
VARS
VAR
KEEP=
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?
MEANS
UNIVARIATE
FREQ
In which phase does the DATA step check for syntax errors?
compilation
execution
What statement is used to read a SAS data set in a DATA step?
DATA statement
WHERE statement
SET statement
assignment statement
To process an Excel file with the DATA step, you must first create a copy of the data as a SAS table.
True
False
What is the name of the output data set in the program below?
work.us
orion.sales
Country
sales
The data set orion.sales contains nine columns. Given this DATA step, how many columns does work.comp contain?
four
nine
five
Given the assignment statement below, what is the value of AvgExp for the observation that is shown?
6
8
. (missing value)
The statement generates a syntax error.
Which of the following SAS functions returns a number from 1 to 12?
YEAR(SAS-date-value)
MONTH(SAS-date-value)
WEEKDAY(SAS-date-value)
none of the above
In the program below, what is the value of Credit if Country is 'au'?
300
500
0
missing
What is the length of the Car_Type column created in this program?
6
7
8
Use a DO group in a DATA step when you want to execute multiple statements for a true IF-THEN expression.
True
False
If you run this program, which title or titles appear in the final PROC PRINT results?
The Top Line
The Top Line
The Next Line
The Top Line
The Second Line
The Top Line
The First Line
The Next Line
Which statement substitutes the value of the macro variable Year in the footnote?
footnote 'year Sales' ;
footnote '&year Sales' ;
footnote "%year Sales" ;
footnote "&year Sales" ;
Which statement is true based on the given program?
The column BatAvg will have a permanent label in the sashelp.baseballtable.
The label for BatAvg will appear in the PRINT report.
The label for BatAvg will appear in the MEANS report.
The label for BatAvg will appear in both reports.
Which statement is true regarding a BY statement in a reporting procedure such as PROC PRINT?
The BY statement is responsible for sorting the table.
Only one column can be specified in the BY statement.
The BY statement groups the report by the specified columns.
The BY statement must be the first statement after the PROC statement
Which statement is false concerning the FREQ procedure?
The NOPROCTITLE option can be placed in the PROC FREQ statement to remove the procedure title of The FREQ Procedure.
The ORDER=FREQ option can be placed in the PROC FREQ statement to display the column values in descending frequency count order.
The PLOTS= option can be placed in the TABLES statement after the forward slash to create bar charts based on counts or percentages.
The OUT= option can be placed in the TABLES statement after the forward slash to create a table containing counts and percentages.
Which PROC FREQ step creates the results shown here?
a
b
c
d
Which report is created from the following PROC FREQ step?
a
b
c
d
Which statement is true concerning the MEANS procedure?
The VAR statement is required and identifies the analysis columns.
The WAYS statement specifies the number of ways to make unique combinations of class columns.
The MAXDEC= option is used in the VAR statement to specify the number of decimal places for the statistics.
The COUNT and FREQ columns are automatically included in the output summary table that is produced by the OUT= option of the OUTPUT statement.
The input table must be pre-sorted by the columns listed in the CLASS statement of a PROC MEANS step.
True
False
Which statement from PROC MEANS contains valid syntax for creating a summary output table?
out=work.summary mean;
out work.summary mean(Weight)=TotW;
output out work.summary Weight=TotW;
output out=work.summary mean(Weight)=TotW;
