Your SAS programs, embedded in web apps and elsewhere

Stored Processes error

Reply
N/A
Posts: 0

Stored Processes error

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.
SAS Super FREQ
Posts: 8,868

Re: Stored Processes error

Posted in reply to deleted_user
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
Ask a Question
Discussion stats
  • 1 reply
  • 174 views
  • 0 likes
  • 2 in conversation