solutions
1. (§1) LIBNAME
A SAS library is a file directory containing SAS data sets. The *LIBNAME*
Command
command associates a SAS name (e.g., 'bios5510') with an existing SAS
library
2. (§1)
Comment
syntax Comments may be included anywhere in a SAS program with the
following syntax:
3. DATA step (defini- A DATA step is a type of SAS program used to create SAS data sets
tion)
4. INFORMAT A DATA step statement specifying the format in which values of the
State- variable are
ment
*read in* from external sources. Can be used in place of the colon (:)
modifier in an INPUT statement.
5. FORMAT State-
A DATA step statement specifying the format in which values of the
ment
variable are
*displayed*, e.g., the following will change 'VAR6' from '17200' to
'02/03/2007'
6. RENAME State-
ment
A DATA step statement to change the names of existing variable. Name
changes occur *after* all statements in the DATA step have been
executed.
1/
20
,SAS - Exam 1 questions with complete
solutions
7. LABEL Statement A DATA step statement to create labels to be displayed in place of
variable names. Specifying a single blank space (" " or ' ') will remove
a variable label.
8. DROP Statement
2/
20
, SAS - Exam 1 questions with complete
solutions
A DATA step statement specifying a set of variables to delete from the data
set
*AFTER* all DATA step statements have been executed.
9. KEEP Statement A DATA step statement specifying a set of variables to keep in the data set
*AFTER* all DATA set statements have been executed.
10. LENGTH A DATA step statement specifying the internal storage lengths (in
State-
bytes) of vari- ables, which must be set *prior* to the assignment of values.
ment
For example, if 'set1' has a 'var1' of length 1 and 'set2' has a 'var1' of
length 2, you would enter:
11. Set
Variable Warning: Values of a variable may be truncated if its length is too small.
Lengths
With
Caution
12. FORMAT v INFOR- FORMAT attribute sets the format in which values of the variable are
*displayed*
MAT
13. DATA Step - 14. DATA Step - For- matted Input
Stan- dard
Input
3/
20