

































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































































The language, log, output, SAS data set and others
JC Wang
Department of Statistics Western Michigan University
September 8, 2009
(^1) The Language
Language Elements SAS Log SAS Libraries
(^2) SAS Data Sets
Two Portions of a SAS Data Set
(^3) SAS Output
SAS Output: An Example
(^4) System Options
(^5) SAS Comments
(^6) Report Writing—Round One
Consists of statements
Statements usually start with keywords
Each statement ends with a semicolon (;)
Words in statements are case insensitive, except for most situations when texts are enclosed in matching quotation marks, single quotes (’) or double quotes (")
Consists of statements
Statements usually start with keywords
Each statement ends with a semicolon (;)
Words in statements are case insensitive, except for most situations when texts are enclosed in matching quotation marks, single quotes (’) or double quotes (")
Consists of statements
Statements usually start with keywords
Each statement ends with a semicolon (;)
Words in statements are case insensitive, except for most situations when texts are enclosed in matching quotation marks, single quotes (’) or double quotes (")
SAS statements are in free format,
they can begin/end anywhere on a line a statement can continue over several lines several statements can be on a line (avoid this)
SAS statements are in free format,
they can begin/end anywhere on a line a statement can continue over several lines several statements can be on a line (avoid this)
SAS statements are in free format,
they can begin/end anywhere on a line a statement can continue over several lines several statements can be on a line (avoid this)
There are two basic building blocks:
Data steps: read raw data, create/modify data, set/change data value, combine/merge/update data sets Proc steps: pre-written procedures that perform various tasks
Note: In addition to above, there are stand-alone statements such as OPTIONS, TITLE, FOOTNOTE, LIBNAME, FILENAME, ...
There are two basic building blocks:
Data steps: read raw data, create/modify data, set/change data value, combine/merge/update data sets Proc steps: pre-written procedures that perform various tasks
Note: In addition to above, there are stand-alone statements such as OPTIONS, TITLE, FOOTNOTE, LIBNAME, FILENAME, ...
DATA & PROC statements signal the beginning of a new step
Subsequent DATA or PROC statements, RUN statements (for DATA steps and most PROC steps) or a QUIT statement(for interactive PROC steps such as PROC DATASETS, PROC GLM, PROC REG, PROC SQL, PROC IML) signal the end of a step
Upon encountering new step, SAS stops reading statements and executes the previous step
DATA & PROC statements signal the beginning of a new step
Subsequent DATA or PROC statements, RUN statements (for DATA steps and most PROC steps) or a QUIT statement(for interactive PROC steps such as PROC DATASETS, PROC GLM, PROC REG, PROC SQL, PROC IML) signal the end of a step
Upon encountering new step, SAS stops reading statements and executes the previous step
DATA & PROC statements signal the beginning of a new step
Subsequent DATA or PROC statements, RUN statements (for DATA steps and most PROC steps) or a QUIT statement(for interactive PROC steps such as PROC DATASETS, PROC GLM, PROC REG, PROC SQL, PROC IML) signal the end of a step
Upon encountering new step, SAS stops reading statements and executes the previous step
upon submitting a program, SAS generates a log of processing activities
See eg01.sas