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

Aus phenixxenia.org
Zur Navigation springen Zur Suche springen
K (Wolf-Dieter Batz verschob die Seite Completed Macro Structure (from Fraktal SAS Programming) nach Fully Qualified Coding (from Fraktal SAS Programming), ohne dabei eine Weiterleitung anzulegen)
K
 
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
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;
 +
/*
 +
[[Parameter Scope (from Fraktal SAS Programming)|declare parameter scope]]
 +
*/
 +
%LOCAL <parameters of local scope>;
 +
%GLOBAL <parameters of global scope>;
 
  /*
 
  /*
  Definition
+
  [[Apply Logic (from Fraktal SAS Programming)|apply static logic for branching]]
 
  */
 
  */
  %MACRO name;
+
  %IF <condition> %THEN %DO;
  program code
+
  <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
+
 
  */
+
  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
 
|links=xx_left.png
 
|links=xx_left.png
|zurück=Realtime Information (from Fraktal SAS Programming)
+
|zurück=Extending Control (from Fraktal SAS Programming)
 
|rechts=xx_right.png
 
|rechts=xx_right.png
|vorwärts=Generalized Approach (from Fraktal SAS Programming)
+
|vorwärts=Straightforward Coding (from Fraktal SAS Programming)
 
|hoch=Duck_zazy_com.png
 
|hoch=Duck_zazy_com.png
 
|übersicht=Macro (from Fraktal SAS Programming)
 
|übersicht=Macro (from Fraktal SAS Programming)
 
}}
 
}}

Aktuelle Version vom 15. Mai 2014, 20:05 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:

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