BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ashpak
Calcite | Level 5

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

You don't define the macro variable datiq anywhere. You could add a %LET statement to define it. For example:

%let datiq = 2;

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

You don't define the macro variable datiq anywhere. You could add a %LET statement to define it. For example:

%let datiq = 2;
qoit
Pyrite | Level 9
What is the value of the macro variable "&datiq"?
Ashpak
Calcite | Level 5
Thanks %Let datiq=0; declaration was missing now fixed thanks for your help

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1308 views
  • 0 likes
  • 3 in conversation