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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 687 views
  • 0 likes
  • 3 in conversation