2
我必須創建EVENT1-EVENT20,但是我正在做mannualy逐一添加,它的痛苦添加所有事件和代碼看起來很醜,有沒有什麼辦法可以簡單地做,如添加宏?如果那麼其他的MACRO
DATA Z3_ALL91;
SET Z3_ALL8;
EVENT1=INPUT('.',$CHAR10.);
EVENT2=INPUT('.',$CHAR10.);
EVENT3=INPUT('.',$CHAR10.);
EVENT4=INPUT('.',$CHAR10.);
IF RE1='HO' THEN EVENT1=ERP1;
IF RE1='RE' THEN EVENT1='REP';
IF RE1='HSS' THEN EVENT1=ERP1;
IF RE2='HO' THEN EVENT2=ERP2; ELSE
IF RE2='RE' THEN EVENT2='REP';ELSE
IF (RE2='HSS' AND ROH1^="") THEN EVENT2=CATX("_",ERP2,ROH1);ELSE EVENT2=ERP2;
IF RE3='HO' THEN EVENT3=ERP3; ELSE
IF RE3='RE' THEN EVENT3='REP';ELSE
IF (RE3='HSS' AND ROH2>ROH1) THEN EVENT3=CATX("_",ERP3,ROH2);ELSE
IF (RE3='HSS' AND ROH1^=".") THEN EVENT3=CATX("_",ERP3,ROH1);ELSE EVENT3=ERP3;
IF RE4='HO' THEN EVENT4=ERP4; ELSE
IF RE4='RE' THEN EVENT4='REP';ELSE
IF (RE4='HSS' AND ROH3>ROH2) THEN EVENT4=CATX("_",ERP4,ROH3);ELSE
IF (RE4='HSS' AND ROH2>ROH1) THEN EVENT4=CATX("_",ERP4,ROH2);ELSE
IF (RE4='HSS' AND ROH1^=".") THEN EVENT4=CATX("_",ERP4,ROH1);ELSE EVENT4=ERP4;
RUN;