BookmarkSubscribeRSS Feed
Not applicable

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;
%else %do ;
%let pdct = &product1;
%do j = 2 %to &prdt0.;
%let pdct = &pdct. &cm. &&product&j. ;

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

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



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.
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.




Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation