SAS Programming Step By Step Tutorial Comments


SAS Comments

In SAS you can create comments in two ways, the first method is called a block comment. These comments can be any length and contain semicolons. Be sure to avoid placing these type of comments symbols in the first or second columns, because in some operating environments SAS might interpret block comment symbols in columns 1 and 2 as a request to end the SAS session or job.

/* this is a block comment */

Example of block comment: Notice the comment in the block comment “Create a temporary data set called MicrosoftStock”

/*Create a temporary data set 
called MicrosoftStock*/
data MicrosoftStock;
set sashelp.stocks;
where stock='Microsoft';
/*print the data */ 
proc print data=MicrosoftStock;
27 rows from the print statement

The second method is called the comment statement, which begins with an asterisk followed by the comment text and ends with a semicolon.

* comment text/ statement;

Example of comment statement: Notice the comment in the comment statement “where stock=’Microsoft’;

Create a temporary data set
called MicrosoftStock
data MicrosoftStock;
set sashelp.stocks;
*where stock= 'Microsoft';
/* Print the data */
proc print data=microsoftstock;
27 rows from the print statement and the where statement commented out

If you are interested in data science and data analytics after reading this article you should check out the website they have many interesting articles and statistics on politics, sports, science, health, economics and culture, you can also check out my blog for more information on free tutorials and books on data analytics/ science. Thanks for reading this article, I hope you found it very helpful and enjoyable as I enjoyed writing it! Happy learning and I will see you all in my next article. Please leave many claps on here and share it, thanks for taking the time out of your busy day to read this article !

Check Out the following for content / videos on Computer Science, Algorithm Analysis, Programming and Logic:

YouTube Channel:



Video Tutorials on Recurrence Relation:

Video Tutorial on Algorithm Analysis: