Hi,
I am trying to create a nested loop but I am getting an error. I am getting the error message: 'Expecting an relational or arithmetic operator'
The code I am using is as follows:
%macro nested_reg;
%do j = 2 %to 3;
%macro variables;
%do i = 1 %to 69;
data regress_&i.(drop = ceiling cdist time_L_ lvol mkt midpoint counter);
set org_dual.dual_&i.;
lvol = log(volume); lvol1 = lag(lvol); lvol2 = lag2(lvol); lvol3 = lag3(lvol);
if cdist1 <= j. then m=1;
else m=0;The error flags at the line (Expecting an relational or arithmetic operator'):
if cdist1 <= j. then m=1;
else m=0;I was hoping that the value of 'j' would be subsituted in here. This is not working, can anyone help me with this issue?
Thanks,
Ed
You Forgot the ampersand,
&j.
Thanks Reeza.
Embarrassed Ed
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.