1: Essentials Flashcards

1
Q
How many steps does this program contain?
data national;
    set sashelp.baseball;
    BatAvg=nHits/nAtBat;
run;

proc contents data=national;
run;

proc print data=national;
run;

proc means data=national;
var BatAvg;
run;

 a. one
 b. two
 c. four
 d. eight
A

C
RUN, QUIT, DATA, and PROC statements function as step boundaries, which determine when SAS statements take effect and indicate the end of the current step or the beginning of a new step.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Running a SAS program can create which of the following?

 a. log
 b. output data
 c. results
 d. all of the above
A

D
A SAS program always creates a log. A program can create output data and results as well, depending on the steps included.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following is a SAS syntax requirement?

 a. Begin each statement in column one.
 b. Put only one statement on each line.
 c. Separate each step with a line space.
 d. End each statement with a semicolon.
A

D
All SAS statements must end with a semicolon, but they are free-format. You can begin or end them anywhere, separate steps with line spaces, and optionally end steps with a RUN statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

 a. DATA
 b. PROC
 c. REPORT
 d. RUN
A

B

PROC steps are typically used to process SAS data sets (that is, generate reports, graphs, and statistics).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
Does this comment contain syntax errors?
 /*
Report created for budget
presentation; revised October 15.
  */
proc print data=work.newloan;
run;

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.

A

A
A block comment can contain semicolons and unbalanced quotation marks, can appear anywhere, and doesn’t need a semicolon at the end.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What result would you expect from submitting this step?
proc print data=work.newsalesemps
run;

 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
A

B
There is a missing semicolon following the data set name. When this step runs, SAS will interpret the word run as an option in the PROC PRINT statement (because of the missing semicolon). As a result, the PROC PRINT step will not execute and an error message will be displayed in the log.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens if you submit the following program?
porc print data=work.newsalesemps;
run;

 a. SAS does not execute the step.
 b. SAS assumes that PROC is misspelled and executes the step.
A

B
The log will indicate that SAS assumed that the keyword PROC was misspelled, corrected it temporarily, and executed the PROC step.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
This program contains a syntax error because National is in different cases.
data national;
    set sashelp.baseball;
    BatAvg=nHits/nAtBat;
run;

proc means data=NATIONAL;
var BatAvg;
run;

 a. True
 b. False
A

B

Case does not matter in unquoted values, so in this case, the data set name can be specified in any case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How many statements does this program contain?
*Create a cars report;

title “European Cars Priced Over 30K”;
footnote “Internal Use Only”;

proc print data=sashelp.cars;
    where Origin='Europe'
          and MSRP>30000;
    var Make Model Type
        Mpg_City Mpg_Highway;
run;
 a. five
 b. six
 c. seven
 d. eight
A

C
This program contains seven statements (seven semicolons): comment, TITLE, FOOTNOTE, PROC, WHERE (two lines), VAR (two lines), and RUN.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the following is not a SAS programming interface?

 a. SAS Enterprise Guide
 b. SAS Manager
 c. SAS Studio
 d. SAS windowing environment
A

B
The programming interfaces include SAS Enterprise Guide (client application), SAS Studio (web-based), and SAS windowing environment. There is not an interface or product named SAS Manager.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly