Loading...

Programming Language

Elements of the SAS Language

The statements that formed the data set WEIGHT_CLUB are part of the SAS programming language. The SAS language contains statements, expressions, functions and CALL routines, options, formats, and in formats – elements that many programming languages split. However, the way you use the elements of the SAS language depends on convinced programming rules. The most important rules are listed in the next two sections.

Rules for SAS Statements
The conventions that are shown in the programs in this documentation, such as indenting of subordinate statements, extra spacing, and blank lines, are for the purpose of clarity and ease of use. They are not necessary by SAS. There are only a few rules for writing SAS statements:

..SAS statements end with a semicolon.
…You can enter SAS statements in lowercase, uppercase, or a mixture of the two.
..You can begin SAS statements in any column of a line and write several statements on the same line.
…You can begin a statement on one line and continue it on another line, but you cannot split a word between two lines.
..Words in SAS statements are divided by blanks or by special characters (such as the equal sign and the minus sign in the calculation of the Loss variable in the WEIGHT_CLUB example).
SAS Language Programming Elements

Rules for Most SAS Names
SAS names are used for SAS data set names, variable names, and other items. The following rules apply:

..A SAS name can contain from one to 32 characters.
..The first character must be a letter or an underscore (_).
..Subsequent characters must be letters, numbers, or underscores.
..Blanks cannot appear in SAS names.
Special Rules for Variable Names
For variable names simply, SAS remembers the combination of uppercase and lowercase letters that you use when you create the variable name. Internally, the case of letters does not matter. “CAT,” “cat,” and “Cat” all represent the same variable. But for presentation purposes, SAS remembers the initial case of each letter and uses it to represent the variable name when printing it.

VirtualNuggets 4895460522315678311

Post a Comment

emo-but-icon

Home item

Blog Archive

Popular Posts

Random Posts

Flickr Photo