Exercises and Projects for The Little SAS Book, Sixth Edition. Lora D. Delwiche
Чтение книги онлайн.
Читать онлайн книгу Exercises and Projects for The Little SAS Book, Sixth Edition - Lora D. Delwiche страница 4
a. A single space
b. A single period
c. Any number of spaces
d. Any of the above
5. What is the main difference in the naming convention for SAS data libraries versus SAS variables?
a. SAS data library names can contain special characters such as $, % and #
b. Variable names are case sensitive
c. SAS data library names can only be up to 8 characters long
d. Variable names can contain underscores
6. What is a SAS data library?
a. A location where SAS data sets are stored
b. A location where the SAS log messages are stored
c. A location where SAS procedure results are stored
d. All of the above
7. How many SAS statements does this program contain?
DATA instock; INFILE supply;
INPUT Brand $
Model $
Quantity;
RUN;
PROC PRINT DATA = instock;
RUN;
a. 2
b. 3
c. 6
d. 7
8. Which statement does not indicate the end of a DATA or PROC step?
a. STOP
b. QUIT
c. END
d. RUN
9. By default, SAS will execute the DATA step one time each for which of the following?
a. Variable
b. Observation
c. Data set
d. Procedure
10. Which of the following is not an interactive environment for editing and submitting SAS programs?
a. SAS windowing environment
b. SAS Studio
c. SAS Enterprise Guide
d. Batch mode
11. What will the value of F be in the data set called TEMPS?
DATA temps;
F = (C * 9/5) + 32;
C = 0;
RUN;
a. .
b. 0
c. 32
d. 34
12. In the SAS windowing environment, you can edit SAS data sets by using which of the following?
a. Results Viewer
b. Output window
c. Results window
d. Viewtable window
13. If a program does not run correctly, where can you find the error messages?
a. The end of the program
b. The log
c. The results
d. The output
14. When you submit a SAS program in an interactive environment, which window or tab will always show activity?
a. Enhanced Editor
b. Log
c. Results
d. Output
15. Which of the following is true about OPTIONS statements?
a. They are specified in DATA steps
b. They are global
c. These statements modify your default settings for future SAS sessions
d. The first OPTIONS statement in a program overrides subsequent ones
16. Suppose you submit the following code. Any output formatted for printing that is created after this statement will have what characteristics?
OPTIONS NUMBER NOCENTER;
a. Left-justified with no page numbers and no date
b. Left-justified with no page numbers with today’s date
c. Left-justified with page numbers and no date
d. Left-justified with page numbers with today’s date
Short Answer
17. Would the layout of the following PROC PRINT code cause SAS to produce an error? Explain why or why not, and rewrite the code so that it is more organized.
PROC
DATA = new; RUN;
18. SAS ignores anything inside a comment. Explain why it is a good idea to add comments to your program.
19. Suppose that you need to record information on the annual salary of employees as a variable in a SAS data set. Would it be better to store this information as a character or numeric variable? Explain your choice.
20. A coworker tells you, “SAS programs always start with a DATA step.” Is this true? Explain why or why not.
21. Explain why SAS data sets are self-documenting.
22. Which will occur first: execution of the last statement in the DATA step or reading of the last observation in an input data set? Explain your choice.
23. Explain in what order SAS processes observations in a DATA step.
24. Explain why it is a good idea to check your SAS log.
25. Describe what a global statement is and identify two such statements.
26. Explain