Page 1 of 1

How to interpret DOS commands from an old macro

Posted: 16 Mar 2021 10:20
by adrostan
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;

Re: How to interpret DOS commands from an old macro

Posted: 16 Mar 2021 10:52
by Squashman
Your code is SAS. This is not a SAS forum. The SAS Institute has a wonderful community forum. I highly recommend you use it.

This forum is used for questions on Windows Scripting Languages. .BAT, Powershell, Vbscript and JScript.

Re: How to interpret DOS commands from an old macro

Posted: 17 Mar 2021 08:36
by adrostan
Thank you so very much!!! Best Regards, Angela