Sample Macro Design Template
/******************************************************************************************
PROGRAM: <program name>.sas
AUTHOR: xxxxxxx
SAS VERSION: 9.4
DESCRIPTION: xxxxx
INPUT:
OUTPUT:
ASSUMPTIONS:
CONSTRAINTS:
DEPENDENCIES:
VERSION HISTORY:
Ver Author Date Description
--- ------------ ----------- -------------------------------
1.0
PARAMETER DESCRIPTION:
Parameter Required? Default Description
AAAA Yes xxxx
BBBB No xxxx
CCCC No xxxx
DEBUG No xxxx switch on options mprint, mlogic, symbolgen
******************************************************************************************/
%******************************************************************************************;
%** start macro;
%******************************************************************************************;
%macro <macro name>
(
Aaaa = ,
bbbb = ,
cccc = ,
debug =
);
%******************************************************************************************;
%** Module 1 – Block 1 - <Description>
%******************************************************************************************;
%**----------------------------------------------------------------------------------------;
%** Step 1;
%**----------------------------------------------------------------------------------------;
< … SAS Code … >
%**----------------------------------------------------------------------------------------;
%** Step 2;
%**----------------------------------------------------------------------------------------;
< … SAS Code … >
%******************************************************************************************;
%** Module 1 – Block 2 - <Description>
%******************************************************************************************;
%**----------------------------------------------------------------------------------------;
%** Step 1;
%**----------------------------------------------------------------------------------------;
< … SAS Code … >
%**----------------------------------------------------------------------------------------;
%** Step 2;
%**----------------------------------------------------------------------------------------;
< … SAS Code … >
%******************************************************************************************;
%** Module 2 - <Description>
%******************************************************************************************;
%**----------------------------------------------------------------------------------------;
%** Step 1;
%**----------------------------------------------------------------------------------------;
< … SAS Code … >
%**----------------------------------------------------------------------------------------;
%** Step 2;
%**----------------------------------------------------------------------------------------;
< … SAS Code … >
%******************************************************************************************;
%** Clean-up
%******************************************************************************************;
%**----------------------------------------------------------------------------------------;
%** Delete work datasets;
%**----------------------------------------------------------------------------------------;
%mend <macro name>;
The study level programmer is responsible for writing the macro and documenting it so that others can understand it. The programmer may want to suggest to the standards committee that the study level macro be made into a global macro.
|