%LET IN1=(sum(sumliab,-sumliabp)>0 AND sum(sumliab,-sumliabp)<100000);
%inoutflow(wu1.custbase2m,work.T8_1a,'N',SA,sap,'IN1');
%macro inoutflow(dsin,dsout,ntb,product,pro1,custclass);
...
...
where 'New Cust Ind'n=&ntb AND 'Ver Date'n = &curdate AND SUM (&product,-&pro1) >=0.01 and &&custclass;
...
%mend
in this macro ,the last input variable is for custclass,
and it has been declared in %let
but this quoting &&custclass is not my intention.
my intention is this &&custclass=(sum(sumliab,-sumliabp)>0 AND sum(sumliab,-sumliabp)<100000);(ln let statement equals value for IN1)
thanks.
From what you posted I believe what you need to do is:
- define the macro before you call it!
%inoutflow must come AFTER %macro inoutflow;.... %mend;
- %inoutflow(wu1.custbase2m,work.T8_1a,'N',SA,sap,&IN1);
Don't use quotes. This way the macro variable resolves and the macro value is passed as parameter to the macro call.
- ...,-&pro1) >=0.01 and &custclass
Only one '&' is needed as the macro variable already contains the resolved value from &IN
Else: You would have to pass &IN1 to the macro call in a way that it doesn't get resolved -> %nrstr(&in1) .... but why would you do that?
Patrick,
It solved my problem.Very thanks. And sorry to put macro-using before defining.
what's worse, I can find "correct answer" click near your discussion.
Dawn
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!
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.