Fully Qualified Coding (from Fraktal SAS Programming): Unterschied zwischen den Versionen

Aus phenixxenia.org
Zur Navigation springen Zur Suche springen
K
K
Zeile 9: Zeile 9:
 
}}
 
}}
  
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 (from Fraktal SAS Programming)|''"Straightforward Coding"'']]:
+
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 (from Fraktal SAS Programming)|''"Straightforward Coding"'']]. The definition structure will be slightly more complex:
  
 +
%MACRO name;
 
  /*
 
  /*
  Definition
+
  [[Parameter Scope (from Fraktal SAS Programming)|declare parameter scope]]
 
  */
 
  */
  %MACRO name;
+
  %LOCAL <parameters of local scope>;
  program code
+
  %GLOBAL <parameters of global scope>;
 +
/*
 +
[[Apply Logic (from Fraktal SAS Programming)|apply static logic for branching]]
 +
*/
 +
%IF <condition> %THEN %DO;
 +
<program code>
 +
%END
 +
%ELSE %DO;
 +
<alternate program code>
 +
%END
 +
/*
 +
[[Process Metadata (from Fraktal SAS Programming)|program code controlled by dynamic metadata]]
 +
<obtain metadata>
 +
<count list elements>
 +
<utilize metadata>
 +
*/
 +
/*
 +
[[Realtime Information (from Fraktal SAS Programming)|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;
 
  %MEND name;
 +
 +
At time of invocation, precautions will be made to trigger and [[Stored Workflow Documentation (from Fraktal SAS Programming)|store]] [[Workflow Documentation (from Fraktal SAS Programming)|workflow documentation]]:
  
 
  /*
 
  /*
 
  Invocation
 
  Invocation
 
  */
 
  */
 +
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;
 
  %NAME;
 +
options nomprint nomfile;
 +
filename mprint clear;
 +
proc printto LOG = LOG;
  
 
{{SeitenNavigation1
 
{{SeitenNavigation1

Version vom 15. Mai 2014, 19:54 Uhr

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:

/*
Invocation
*/
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