I am getting error on below codes unable to call macro , could you please help to fix this errors
Data work.params;
input qdbs$5. strgs$50.;
datalines;
JAN21 Mar9QF Strategy
Dec20 FRB Base Strategy
;
run;
%macro NVPstg_Loop;
%do i = 1 %to &datiq;
data _null_;
set work.params;
if _n_ = &i then do;
call symputx ('q', qdbs);
call symputx ('s', strgs);
%put &q &s;
end;
run;
%Run_Pricing(&q,&s);
%end;
%mend;
proc print;
%cnts;
%NVPstg_Loop;
getting Error message
WARNING: Apparent symbolic reference DATIQ not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:
(&datiq)
ERROR: The %TO value of the %DO I loop is invalid.
You don't define the macro variable datiq anywhere. You could add a %LET statement to define it. For example:
%let datiq = 2;
You don't define the macro variable datiq anywhere. You could add a %LET statement to define it. For example:
%let datiq = 2;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.