|
SAS programmers use bracket-style comments or comment statements to block segments of code from execution. Using bracket-style comments on MVS/TSO environment can be resulted a JCL error when users placed them in the wrong position. The bracket-style comments should not be aligned to JCL statements.
|
//USR0C2CT JOB (),'CMC',MSGLEVEL=(1,1),
// MSGCLASS=X,REGION=4096K,CLASS=A,
// NOTIFY=USR0C2C
//STEP1 EXEC SAS8
//WORK DD UNIT=SYSDA,SPACE=(CYL,(900,800),RLSE)
//INDME DD DISP=SHR,DSN=TESTS.RST.CMC.INCARE.TERMPHYS
//OUTDME DD DSN=TESTS.RST.CMC.INCARE.TERMPHYS,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,50),RLSE)
//SYSIN DD *
/*
data test;
set qprecs.claims;
run;
*/
/*
data test;
set qprecs.claims;
run;
*/
|
|
Although comment statements would do the job, however, users may find it too tedious putting an asterisk in every before SAS statement and removing them all when the SAS statements need to be executed.
|
* proc sort data=qprecs
* (drop=nolob noid noct noemp noben nogender
* nocpt nopdx nospec noprov noptype)
* nodupkey;
* by claims;
* run;
|
|
Another solution and perhaps less troublesome is by assigning a macro statement, where users ask the SAS macro facility to store a part of code not to be executed. In this example I define my macro statement as OMIT. OMIT statement prevents part or any SAS statements from being compiled and executed. These SAS statements can be from a DATA step to PROC step to any other macros.
|
%macro omit;
ods html body=report1 style=minimal rs=none;
proc report data=qprecs headline headskip spacing=2 nowd split='*';
title3 'Frequency Counts for Missing Values';
column file month nolob noid noct noemp noben nogender nocpt
nopdx nospec noprov noptype;
define file/group order=data width=6 format=filef. 'Data*Source';
define month/group order=data width=10 format=mnth. 'Month';
define nolob/sum width=5 format=comma9. 'LOB';
define noid/sum width=9 format=comma9. 'MemberID';
define noct/sum width=6 format=comma9. 'Center';
define noct/sum width=6 format=comma9. 'Center';
define noemp/sum width=6 format=comma9. 'EmpGrp';
define noben/sum width=6 format=comma9. 'BenSet';
define nogender/sum width=6 format=comma9. 'Gender';
define nocpt/sum width=5 format=comma9. 'CPT-4';
define nopdx/sum width=5 format=comma9. 'ICD9';
define nospec/sum width=8 format=comma9. 'ProvSpec';
define noprov/sum width=7 format=comma9. 'ProvNum';
define noptype/sum width=8 format=comma9. 'ProvType';
break after file/ul skip suppress;
rbreak after/dol dul skip summarize;
run;
ods close listing;
%mend;
|
|
Users may find this technique easy to use as well as the assigned name can be repeated without changing different names (i.e. OMIT1, OMIT2, etc). As always, a %MEND statement at the end of the assigned macro statement should not be omitted. Otherwise it will be resulted to errors.
|
|