SAS CHAPTER 1 QUESTIONS AND ANSWERS
What commands do you use to read raw data files? - Answers -FORMATTED and LIST
What statement do you use to control processing when you read raw data files? -
Answers -INFILE
What is the maximum length for a SAS variable name? - Answers -32
data work.portion;
set sashelp.retail(firstobs=5 obs= 10);
run;
How many observations are in the output data set? - Answers -6
Types of steps in a SAS program - Answers -1. DATA step
2. PROC (procedure) step
The input for a DATA step can be of how many types? - Answers -several types (raw
data or SAS data set)
The output for a DATA step can be of how many types? - Answers -several types (SAS
data or a report)
data work.enroll;
infile 'enrollment.dat';
What might a SAS statement include? - Answers -1. keywords
2. SAS names
3. special characters
4. operators
What are the 2 types of SAS statements? - Answers -1. those that are used in DATA
and PROC steps
2. those that are global in scope and can be used anywhere in a SAS program
proc sort data=work.enroll
out=project.enroll;
by last;
run;
proc print data=project.enroll;
var last state2_age_enrolldata;
format enrolldate mmddyy10.;
, run;
How many statements are in the PROC SORT step? - Answers -3
Where can Global statements be used? - Answers -Anywhere in a SAS program
How long do Global statements stay in effect? - Answers -stay in effect until changed or
canceled or until you end your SAS session
libname project 'C:\workshop\winsas\lwcrb';
proc sort data=work.enroll
out=project.enroll;
by last;
run;
What is the Global statement? - Answers -libname project 'C:\workshop\winsas\lwcrb';
What are examples of Global statements?
1. DATA
2. TITLE
3. LABEL
4. FORMAT
5. OPTIONS
6. FOOTNOTE - Answers -2. TITLE
5. OPTIONS
6. FOOTNOTES
A SAS data set has these 3 characteristics - Answers -1. is a SAS file stored in a SAS
library that SAS creates and processes
2. contains data value that are organized as a table of observations (rows) and
variables (columns)
3. contains descriptor info such as the data types and lengths of the variables
What do the commands in each line do? - Answers -1. output data set
2. input raw data
Do all SAS programs contain a DATA step? - Answers -No
What does the PROC step do? - Answers -1. analyzes data
2. produces output
3. manages SAS files
What is usually the input for a PROC step? - Answers -a SAS data set
What commands do you use to read raw data files? - Answers -FORMATTED and LIST
What statement do you use to control processing when you read raw data files? -
Answers -INFILE
What is the maximum length for a SAS variable name? - Answers -32
data work.portion;
set sashelp.retail(firstobs=5 obs= 10);
run;
How many observations are in the output data set? - Answers -6
Types of steps in a SAS program - Answers -1. DATA step
2. PROC (procedure) step
The input for a DATA step can be of how many types? - Answers -several types (raw
data or SAS data set)
The output for a DATA step can be of how many types? - Answers -several types (SAS
data or a report)
data work.enroll;
infile 'enrollment.dat';
What might a SAS statement include? - Answers -1. keywords
2. SAS names
3. special characters
4. operators
What are the 2 types of SAS statements? - Answers -1. those that are used in DATA
and PROC steps
2. those that are global in scope and can be used anywhere in a SAS program
proc sort data=work.enroll
out=project.enroll;
by last;
run;
proc print data=project.enroll;
var last state2_age_enrolldata;
format enrolldate mmddyy10.;
, run;
How many statements are in the PROC SORT step? - Answers -3
Where can Global statements be used? - Answers -Anywhere in a SAS program
How long do Global statements stay in effect? - Answers -stay in effect until changed or
canceled or until you end your SAS session
libname project 'C:\workshop\winsas\lwcrb';
proc sort data=work.enroll
out=project.enroll;
by last;
run;
What is the Global statement? - Answers -libname project 'C:\workshop\winsas\lwcrb';
What are examples of Global statements?
1. DATA
2. TITLE
3. LABEL
4. FORMAT
5. OPTIONS
6. FOOTNOTE - Answers -2. TITLE
5. OPTIONS
6. FOOTNOTES
A SAS data set has these 3 characteristics - Answers -1. is a SAS file stored in a SAS
library that SAS creates and processes
2. contains data value that are organized as a table of observations (rows) and
variables (columns)
3. contains descriptor info such as the data types and lengths of the variables
What do the commands in each line do? - Answers -1. output data set
2. input raw data
Do all SAS programs contain a DATA step? - Answers -No
What does the PROC step do? - Answers -1. analyzes data
2. produces output
3. manages SAS files
What is usually the input for a PROC step? - Answers -a SAS data set