BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I am using the code as below and want to write commenets to make the code understanding , kindly correct me if I am wrong soemwhere :-


ods rtf file='Corr.rtf'/*initialise and send results to the RTF file Corr.rtf until the file is closed*/;
proc corr data = review1 outest = Corr/*create a temporary dataset Corr */;
VAR Z X Y/*determine the correlation between each variable*/;
RUN;
ods rtf close /* close the RTF file Corr*/;

Kindest Regards
Mark
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The comments are syntactically correct.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

comment statement site:sas.com Message was edited by: sbb
Cynthia_sas
SAS Super FREQ
Hi:
As Scott said, your comments are syntactically correct. However, if you ever want to "comment out" an entire step or block of code, you will not be able to put /* and */ around your PROC CORR step because you are already using that syntax.

You might want to consider adding a bit of white space and/or not mixing commas inside your complete statements (put the comment outside the semi-colon). The first example could have the entire step commented out because you use *; type of comments. The second example is a variation on your original code,

Either of these models seems easier to read to me. Indenting code and using white space seem to increase readability.

cynthia

[pre]

Example 1
*******************************************************************************;
* initialise and send results to the RTF file Corr.rtf until the file is closed;
* create a temporary dataset Corr;
* determine the correlation between each variable;
* close the RTF file Corr;
*******************************************************************************;

ods rtf file='Corr.rtf';

proc corr data = review1 outest = Corr;
VAR Z X Y;
RUN;

ods rtf close;


Example 2

ods rtf file='Corr.rtf'; /*initialise and send results to the RTF file Corr.rtf until the file is closed*/

proc corr data = review1
outest = Corr; /*create a temporary dataset Corr */
VAR Z X Y; /*determine the correlation between each variable*/
RUN;

ods rtf close; /* close the RTF file Corr*/



[/pre]

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 816 views
  • 0 likes
  • 3 in conversation