BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

When I try to run a stored processes using the code I get apparent symbol not resolved. Please help.

%macro std_prd

%if &prdt0 < 2 %then %do ;
%let pdct = &product1;
%end;
%else %do ;
%let pdct = &product1;
%do j = 2 %to &prdt0.;
%let pdct = &pdct. &cm. &&product&j. ;
%end;
%end;

%if &mkt_dec0 < 2 %then %do ;
%let mdec = &mkt_dec1;
%end;
%else %do ;
%let mdec = &mkt_dec1;
%do j = 2 %to &mkt_dec0.;
%let mdec = &mdec. &cm. &&mkt_dec&j. ;
%end;
%end;

%if &prd_dec0 < 2 %then %do ;
%let pdec = &prd_dec1;
%end;
%else %do ;
%let pdec = &prd_dec1;
%do j = 2 %to &prd_dec0.;
%let pdec = &pdec. &cm. &&prd_dec&j. ;
%end;
%end;

%mend;

%std_prd;


MLOGIC(STD_PRD): Beginning execution.
SYMBOLGEN: Macro variable PRODUCT0 resolves to 0
MLOGIC(STD_PRD): %IF condition &product0 < 2 is TRUE
MLOGIC(STD_PRD): %LET (variable name is PDCT)
WARNING: Apparent symbolic reference PRODUCT1 not resolved.
SYMBOLGEN: Macro variable MKT_DEC0 resolves to 0
MLOGIC(STD_PRD): %IF condition &mkt_dec0 < 2 is TRUE
MLOGIC(STD_PRD): %LET (variable name is MDEC)
WARNING: Apparent symbolic reference MKT_DEC1 not resolved.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
I suggest you do some debugging by using %PUT statements inside the macro program, so you can track how the various values are getting set/changed.

Also, I would recommend testing this macro program as a standalone program. My rule for writing a stored process (SP) is to have a working SAS program -- one that executes correctly in a standalone SAS session (such as running from Display Manager or an EG code node) BEFORE turning that program and/or its macro programs into a stored process.

You might also consider working with Tech Support on this issue, as it is hard to debug a stored process without seeing how the SP is defined, what server it's running on, what parameters are being passed, etc, etc. In fact, this code snippet doesn't look like -ALL- of your stored process -- it looks like a macro that's being used -inside- a bigger stored process program. Where are your %stpbegin/%stpend -- what output is being generated by the SP - -what is the purpose of this macro program??? Tech Support could look at your WHOLE stored process and all of your code and they may be able to help you come to a quicker resolution.

cynthia

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
  • 1 reply
  • 831 views
  • 0 likes
  • 2 in conversation