MACRO TWO CATV: Unterschied zwischen den Versionen

Aus phenixxenia.org
Zur Navigation springen Zur Suche springen
K
K
Zeile 8: Zeile 8:
 
|übersicht=User Modules (from Phase-III Macro System)
 
|übersicht=User Modules (from Phase-III Macro System)
 
}}
 
}}
 
[[Datei:FRAKTAL_MACRO_ARCHITECTURE.png|200px|thumb]]
 
  
 
== Type ==
 
== Type ==
  
 
'''User module''' from [[Phase-III Macro System]] based on '''''[[Fraktal SAS Programming|Fractal System Architecture]]'''''.
 
'''User module''' from [[Phase-III Macro System]] based on '''''[[Fraktal SAS Programming|Fractal System Architecture]]'''''.
 
== Workflow ==
 
 
[[Datei:MACRO_TWO_CATV.png]]
 
  
 
== Parameters ==
 
== Parameters ==
Zeile 52: Zeile 46:
 
|}
 
|}
  
== Source ==
 
  
=== Start Definition with Parameters and Defaults ===
+
== Workflow / Source ==
 +
 
 +
{| class="wikitable"
 +
|-
 +
| style="width:35%;"|[[Datei:MACRO_BLK_CATV.png|thumb|center|Workflow]]
 +
|
 +
; Start Definition with Parameters and Defaults
  
 
  %MACRO TWO_CATV(dsn=
 
  %MACRO TWO_CATV(dsn=
Zeile 75: Zeile 74:
 
  ;
 
  ;
  
=== Declares and Upper Level Processing ===
+
;Declares and Upper Level Processing
  
 
  %LOCAL n_grp v_grp n name;
 
  %LOCAL n_grp v_grp n name;
Zeile 109: Zeile 108:
 
  ;
 
  ;
  
=== Loop for Lower Level Processing ===
+
;Loop for Lower Level Processing
  
 
  '''%DO n=1 %TO &N_GRP;'''
 
  '''%DO n=1 %TO &N_GRP;'''
Zeile 142: Zeile 141:
 
  '''%END;'''
 
  '''%END;'''
  
=== Care for Naming and Send Completion Mail ===
+
;Care for Naming and Send Completion Mail
  
 
  '''%IF &TAB_NAME ne %THEN %DO;'''
 
  '''%IF &TAB_NAME ne %THEN %DO;'''
Zeile 158: Zeile 157:
 
  %GEN_MAIL(name=&NAME);
 
  %GEN_MAIL(name=&NAME);
  
=== Close Definition ===
+
;Close Definition
  
 
  %MEND TWO_CATV;
 
  %MEND TWO_CATV;
 +
|}

Version vom 6. März 2014, 12:48 Uhr

Zurück

Übersicht

Vorwärts

Type

User module from Phase-III Macro System based on Fractal System Architecture.

Parameters

Name Description
dsn input dataset name
row, row2 categorial variable name, 2=nested variable
exclude decode for excluded group from &ROW
weight Y/N (multiply percentages for &ROW and &ROW2)
col categorial variable name used for columns
head2 Y/N (block header for nested variable)
indent, indinc n (number of indent columns and increment for nested variable)
num n (sequence number of output)
stat Y/N (column with statistics names)
space 1/2/3 (blank line before or after output and between nesting levels)
struct, struct2 name of reference dataset used for full decode structure, 2=nested variable
condense var#value (non-distinct variable and true value for &ROW)
misslin2 Y/N (force missing line for nested variable)


Workflow / Source

Workflow
Start Definition with Parameters and Defaults
%MACRO TWO_CATV(dsn=
               ,exclude=
               ,row=
               ,row2=
               ,col=
               ,indent=0
               ,num=
               ,stat=N
               ,weight=Y
               ,space=2
               ,condense=
               ,struct=
               ,struct2=
               ,head2=N
               ,misslin2=
               ,indinc=2)
/ store des="" 
;
Declares and Upper Level Processing
%LOCAL n_grp v_grp n name;
%LET name=TWO_CATV;
%IF &STRUCT  eq %THEN %LET struct =&DSN;
%IF &STRUCT2 eq %THEN %LET struct2=&DSN;
%GRP_DESC(dsn=&DSN
         ,grp=&ROW
         ,miss=n)
;
%TOP_FILT(dsn=&DSN
         ,grp=&ROW
         ,by=&COL
         ,grplvl=&NUM
         ,var=
         ,condense=&CONDENSE)
;
%TOP_FREQ(dsn=top_filt
         ,struct=&STRUCT
         ,grp=&ROW
         ,by=&COL)
;
%TOP_OUTC(dsn=top_freq
         ,head=n
         ,total=n
         ,stat=&STAT
         ,indent=&INDENT
         ,grp=&ROW
         ,rev=n
         ,use=
         ,by=&COL
         ,missline=)
;
Loop for Lower Level Processing
%DO n=1 %TO &N_GRP;
  %IF %SCAN(&V_GRP,&N) ne &EXCLUDE %THEN %DO;
    %ROW_FILT(dsn=&DSN
             ,context=&ROW
             ,subgrp=&N
             ,grp=&ROW2
             ,by=&COL
             ,var=
             ,miss=n)
    ;
    %ROW_FREQ(dsn=row_filt
             ,sum=top_freq
             ,struct=&STRUCT2
             ,context=&ROW
             ,grp=&ROW2
             ,by=&COL
             ,weight=&WEIGHT)
    ;
    %ROW_OUTC(dsn=row_freq
             ,sum=main_3rd
             ,head=&HEAD2
             ,stat=&STAT
             ,indent=%EVAL(&INDENT+&INDINC)
             ,context=&ROW
             ,grp=&ROW2 
             ,by=&COL
             ,missline=&MISSLIN2)
    ;
  %END;
%END;
Care for Naming and Send Completion Mail
%IF &TAB_NAME ne %THEN %DO;
  data %SUBSTR(&TAB_NAME,1,3)&NUM%SUBSTR(&TAB_NAME,5,4);
  set
  %DO n=1 %TO &N_GRP;
    %IF &SPACE eq 1 %THEN dummy ;
    %IF %SCAN(&V_GRP,&N) ne &EXCLUDE %THEN row&NUM._&N ;
    %IF &SPACE eq 2 %THEN dummy ;
  %END;
    %IF &SPACE eq 3 %THEN dummy ;
   ;
  run;
%END;
%GEN_MAIL(name=&NAME);
Close Definition
%MEND TWO_CATV;