Fully Qualified Coding (from Fraktal SAS Programming)

Aus phenixxenia.org
Wechseln zu: Navigation, Suche

Zurück

Übersicht

Vorwärts

With all forementioned aspects in mind and applied, our SAS macro will now look very much different from the original MACRO definition in "Straightforward Coding". The definition structure will be slightly more complex:

%MACRO name;
/*
declare parameter scope
*/
%LOCAL <parameters of local scope>;
%GLOBAL <parameters of global scope>;
/*
apply static logic for branching
*/
%IF <condition> %THEN %DO;
<program code>
%END;
%ELSE %DO;
<alternate program code>
%END;
/*
program code controlled by dynamic metadata
*/
<obtain metadata>
<count list elements>
<utilize metadata>
/*
send mail for realtime information
*/
<create fileref with mail tags and define attachements>
<use fileref to edit mail body and trigger mail submission>
%MEND name;

At time of invocation, precautions will be made to trigger and store workflow documentation:

proc printto LOG = "C:\TEMP\MyLOG.txt"; 
systask command "del C:\TEMP\MyCODE.sas" wait;
filename mprint "C:\TEMP\MyCODE.sas";
options mprint mfile;
%NAME;
options nomprint nomfile;
filename mprint clear;
proc printto LOG = LOG; 

Zurück

Übersicht

Vorwärts