Hello to SAS professionals, I'm running a code below, which is shared by my professor. However, the error 180-322 keeps showing after I run the macros, and I cannot find where I did wrong. The coding within "StkRun" runs without problem. Thank you a lot! data time;
length ymd $8.;
infile "D:\Schedule\Finance 2022\projects\DtaqTxt\DtaqDays.txt" recfm=v;
input ymd;
if _n_=3 then stop;
run;
*read tics;
data sym;
length stk $10.;
infile "D:\Schedule\Finance 2022\projects\DtaqTxt\StkLst.txt" recfm=v;
input stk mrnk;
if _n_=3 then stop;
run;
*set stock macro call file;
data x2;
set time;
file "D:\Schedule\Finance 2022\projects\dataMac.txt";
put '%let ymd='ymd';%YmdRun;';
;*%mend;*);*';*";**/;
run;
*to solve the error of NOTE 49-169*;
data x2;
set Sym;
file "D:\Schedule\Finance 2022\projects\StkMac.txt";
put '%let stk='stk';%let mrnk='mrnk'%StkRun;'
;*%mend;*);*';*";**/;
run;
%macro StkRun;
data temp;
array exAsk(17) _temporary_;
array exBid(17) _temporary_;
array xadpth(17) _temporary_;
array xbdpth(17) _temporary_;
length tq $1. oex $1. con $4.;
exchL="ABCDIJKMNTPSTWXYZ";
*Charater set to ID index number of exchange;
eps=0.0001;
*recfm: specifies the record format: v=variable format;
infile "D:\Schedule\Finance 2022\projects\DtaqTxt\&date\&stk..txt" recfm=v missover;
input tq tm oex pask vbid con bask bbid adpt bdpt;
*find best Ask, Bid, and total NBBO depth*;
if tq='Q' then do;
Expnt=index(exchL,oex);
if pask<=0 then
ExAsk(Expnt)=99999;
else
ExAsk(Expnt)=pask;
ExAsk(Expnt)=pask;
Exbid(Expnt)=vbid;
Xadpth(Expnt)=adpt;
Xbdpth(Expnt)=bdpt;
end;
minask=min(of ExAsk[*]);
maxbid=max(of Exbid[*]);
do i=1 to 17;
if (ExAsk(i)<=minask+eps) and (ExAsk(i)>=minask-eps) then
BaskDpth=BaskDpth+Xadpth(i);
if (Exbid(i)<=maxbid+eps) and (Exbid(i)>=maxbid-eps) then
BbidDpth=BbidDpth+xbdpth(i);
end;
if _n_>25 then stop;
run;
%put ---- stock is &stk;
%mend;
options nonotes;
%macro YmdRun;
%include 'D:\Schedule\Finance 2022\projects\StkMac.txt';
%put ------&ymd;
%mend;
%include 'D:\Schedule\Finance 2022\projects\dataMac.txt';
... View more