There are various ways to prevent code from executing:
- /*comment out using asterisk slash*/ pieces of code enclosed by asterisk slash are treated as comments by sas and ignored.
- *comment using asterisk; pieces of code enclosed by asterisk and ';' are treated as comments and ignored by sas.
- %macro junk; enclose code as a macro; %mend; pieces of code enclosed as macro are ignored. This is extremely useful since method1 and 2 only work if there are no other comments in between. Junk can be replaced with any word.
/* this is sample code */
proc means;
table age;
run;
/* this is second proc */
proc univariate;
var age;
run;
If this code needs to be ignored as a whole, method 1 would generate a error and method 2 will be tedious. This kind of code can be prevented from executing as follows:
%macro abcdg;
/* this is sample code */
proc means;
table age;
run;
/* this is second proc */
proc univariate;
var age;
run;
%mend;