MACRO TWO BOBO
Version vom 5. März 2014, 20:52 Uhr von Wolf-Dieter Batz (Diskussion | Beiträge)
Type
User module from Phase-III Macro System based on Fractal System Architecture.
Workflow
Source
%MACRO TWO_BOBO(dsn=,use=,use2=,row=,row2=,col=,indent=0,indinc=2,num=,total=T,stat=Y,weight=Y,rev=N,space=2,condense=,struct=,struct2=,head=Y,head2=N) / store des="Create hierarchy from two boolean vars";
%LOCAL n_lst v_lst row_n use_n n_grp v_grp n i name; %LET name=TWO_BOBO; %IF &STRUCT eq %THEN %LET struct =&DSN; %CHK_LIST(list=&ROW2); %GRP_DESC(dsn=&DSN,grp=&ROW,miss=n); %TOP_FILT(dsn=&DSN,grp=&ROW,grp2=,by=&COL,grplvl=&NUM,var=,condense=&CONDENSE); %TOP_FREQ(dsn=top_filt,struct=&STRUCT,grp=&ROW,by=&COL); %TOP_OUTC(dsn=top_freq,head=&HEAD,total=&TOTAL,stat=&STAT,indent=&INDENT,grp=&ROW,rev=&REV,use=&USE,by=&COL); %IF &STRUCT2 eq %THEN %LET struct2=top_filt; %DO n=1 %TO &N_LST; %LET row_n = %SCAN(%SCAN(&V_LST,&N,|),1,#); %LET use_n = %SCAN(%SCAN(&V_LST,&N,|),2,#); %DO i=1 %TO &N_GRP; %IF %SCAN(&V_GRP,&I,|) eq &USE2 %THEN %DO; %ROW_FILT(dsn=&DSN,context=&ROW,subgrp=&I,grp=&ROW_N,by=&COL,var=,miss=n); %ROW_FREQ(dsn=row_filt,sum=top_freq,struct=&STRUCT2,context=&ROW,grp=&ROW_N,by=&COL,weight=&WEIGHT); %LET cursub=&N; %ROW_OUTC(dsn=row_freq,sum=,head=&HEAD2,stat=&STAT,indent=%EVAL(&INDENT+&INDINC),context=&ROW,grp=&ROW_N,use=&USE_N,by=&COL); %END; %END; %END; %IF &TAB_NAME ne %THEN %DO; data %SUBSTR(&TAB_NAME,1,3)&NUM%SUBSTR(&TAB_NAME,5,4); set row&NUM._0(where=(class not contains "Missing")) %IF &SPACE eq 1 %THEN dummy; %DO n=1 %TO &N_LST; %IF &SPACE eq 2 %THEN dummy; row&NUM._&N %END; %IF &SPACE eq 2 %THEN dummy; row&NUM._0(where=(class contains "Missing")) %IF &SPACE eq 3 %THEN dummy; ; run; %END; %GEN_MAIL(name=&NAME);
%MEND TWO_BOBO;