Previous Page | Next Page

Statements

Comment Statement



Specifies the purpose of the statement or program.
Valid: anywhere
Category: Log Control

Syntax
Arguments
Details
Examples

Syntax

*message;
or
/*message*/


Arguments

*message;

specifies the text that explains or documents the statement or program.

Range: These comments can be any length and are terminated with a semicolon.
Restriction: These comments must be written as separate statements.
Restriction: These comments cannot contain internal semicolons or unmatched quotation marks.
Restriction: A macro statement or macro variable reference that is contained inside this form of comment is processed by the SAS macro facility. This form of comment cannot be used to hide text from the SAS macro facility.
Tip: When using comments within a macro definition or to hide text from the SAS macro facility, use this style comment:
   /* message */
/*message*/

specifies the text that explains or documents the statement or program.

Range: These comments can be any length.
Restriction: This type of comment cannot be nested.
Tip: These comments can contain semicolons and unmatched quotation marks.
Tip: You can write these comments within statements or anywhere a single blank can appear in your SAS code.
Tip: In the Microsoft Windows operating environment, if you use the Enhanced Editor, you can comment out a block of code by highlighting the block and then pressing CTRL-/ (forward slash). To uncomment a block of code, highlight the block and press CTRL-SHIFT-/ (forward slash).

Details

You can use the comment statement anywhere in a SAS program to document the purpose of the program, explain unusual segments of the program, or describe steps in a complex program or calculation. SAS ignores text in comment statements during processing.

CAUTION:
Avoid placing the /* comment symbols in columns 1 and 2.

In some operating environments, SAS might interpret a /* in columns 1 and 2 as a request to end the SAS program or session.   [cautionend]

Note:   You can add these lines to your code to fix unmatched comment tags, unmatched quotation marks, and missing semicolons.

/* '; * "; */; 
quit; 
run;

  [cautionend]


Examples

These examples illustrate the two types of comments:

Previous Page | Next Page | Top of Page