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 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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