How to interpret DOS commands from an old macro
Posted: 16 Mar 2021 10:20
Hello,
I am trying to interpret the DOS commands in an old macro. We are trying to validate this process and want to be able to replicate the actions taken. I would greatly appreciate your help or if you could forward me to another site, it would be greatly appreciated. See Below. Thanks so very much!!!
%MACRO MMODEL2;
DATA STABLNEW TEMP2 (KEEP=BNO BATCH); SET STABLNEW; BY BATCH;
RETAIN BNO 0;
IF FIRST.BATCH THEN DO; BNO=BNO+1; OUTPUT TEMP2; END;
%DO I = 1 %TO %EVAL(&NBATCH-1);
IF BNO = &I THEN DUMMY&I=1;
ELSE DUMMY&I=0;
%END;
OUTPUT STABLNEW;
PROC REG DATA=STABLNEW OUTEST=FITTED NOPRINT;
MODEL LEVEL = %DO I=1 %TO %EVAL(&NBATCH-1);
DUMMY&I
%END; TIME;
OUTPUT OUT=LIB.MODELXP1 P=PREDICT STDP=STD_ERR;
DATA FITTED; SET FITTED(RENAME=(INTERCEP=TEMP));
KEEP INTERCEP TIME BNO;
%DO I=1 %TO %EVAL(&NBATCH-1);
BNO=&i;
INTERCEP=TEMP+DUMMY&I;
OUTPUT;
%END;
INTERCEP=TEMP;
BNO=&NBATCH;
OUTPUT;
DATA FITTED; MERGE FITTED TEMP2; BY BNO;
%MODELX
%MEND MMODEL2;
I am trying to interpret the DOS commands in an old macro. We are trying to validate this process and want to be able to replicate the actions taken. I would greatly appreciate your help or if you could forward me to another site, it would be greatly appreciated. See Below. Thanks so very much!!!
%MACRO MMODEL2;
DATA STABLNEW TEMP2 (KEEP=BNO BATCH); SET STABLNEW; BY BATCH;
RETAIN BNO 0;
IF FIRST.BATCH THEN DO; BNO=BNO+1; OUTPUT TEMP2; END;
%DO I = 1 %TO %EVAL(&NBATCH-1);
IF BNO = &I THEN DUMMY&I=1;
ELSE DUMMY&I=0;
%END;
OUTPUT STABLNEW;
PROC REG DATA=STABLNEW OUTEST=FITTED NOPRINT;
MODEL LEVEL = %DO I=1 %TO %EVAL(&NBATCH-1);
DUMMY&I
%END; TIME;
OUTPUT OUT=LIB.MODELXP1 P=PREDICT STDP=STD_ERR;
DATA FITTED; SET FITTED(RENAME=(INTERCEP=TEMP));
KEEP INTERCEP TIME BNO;
%DO I=1 %TO %EVAL(&NBATCH-1);
BNO=&i;
INTERCEP=TEMP+DUMMY&I;
OUTPUT;
%END;
INTERCEP=TEMP;
BNO=&NBATCH;
OUTPUT;
DATA FITTED; MERGE FITTED TEMP2; BY BNO;
%MODELX
%MEND MMODEL2;