Statements


Definition of Statements

A SAS statement is a series of items that may include keywords, SAS names , special characters , and operators. All SAS statements end with a semicolon. A SAS statement either requests SAS to perform an operation or gives information to the system.

This section covers two kinds of SAS statements:

  • those that are used in DATA step programming

  • those that are global in scope and can be used anywhere in a SAS program.

Base SAS Procedures Guide gives detailed descriptions of the SAS statements that are specific to each SAS procedure. SAS Output Delivery System: User's Guide gives detailed descriptions of the Output Delivery System (ODS) statements.

Executable and Declarative DATA Step Statements

DATA step statements are executable or declarative statements that can appear in the DATA step. Executable statements result in some action during individual iterations of the DATA step; declarative statements supply information to SAS and take effect when the system compiles program statements.

The following tables show the SAS executable and declarative statements that you can use in the DATA step.

Table 4.7: Executable Statements in the DATA Step

Executable Statements

ABORT

IF, Subsetting

PUT

assignment

IF-THEN/ELSE

PUT, Column

CALL

INFILE

PUT, Formatted

CONTINUE

INPUT

PUT, List

DECLARE

INPUT, Column

PUT, Named

DELETE

INPUT, Formatted

PUT, _ODS_

DESCRIBE

INPUT, List

PUTLOG

DISPLAY

INPUT, Named

REDIRECT

DO

LEAVE

REMOVE

DO, Iterative

LINK

REPLACE

DO Until

LIST

RETURN

DO While

LOSTCARD

SELECT

ERROR

MERGE

SET

EXECUTE

MODIFY

STOP

FILE

_NEW_

Sum

FILE, ODS

Null

UPDATE

GO TO

OUTPUT

 
Table 4.8: Declarative Statements in the DATA Step

Declarative Statements

ARRAY

DATALINES

LABEL

Array Reference

DATALINES4

Labels, Statement

ATTRIB

DROP

LENGTH

BY

END

RENAME

CARDS

FORMAT

RETAIN

CARDS4

INFORMAT

WHERE

DATA

KEEP

WINDOW

Global Statements

Global statements generally provide information to SAS, request information or data, move between different modes of execution, or set values for system options. Other global statements (ODS statements) deliver output in a variety of formats, such as in Hypertext Markup Language (HTML). You can use global statements anywhere in a SAS program. Global statements are not executable; they take effect as soon as SAS compiles program statements.

Other SAS software products have additional global statements that are used with those products. For information, see the SAS documentation for those products.




SAS 9.1 Language Reference. Concepts
SAS 9.1 Language Reference Concepts
ISBN: 1590471989
EAN: 2147483647
Year: 2004
Pages: 255

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net