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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.