Macro resolution help again

Accepted Solution Solved
Reply
Regular Contributor
Posts: 212
Accepted Solution

Macro resolution help again

[ Edited ]

Still struggling now with a slightly different syntax issue.  My program reads in the Rule variable as:

 

Rule:

NVL(A.INTER_SCF_EXCL_IND ,'T') <> NVL(B.INTER_SCF_EXCL_IND ,'T')

 

But the %PUT statement is still outputting a trucated version:

 

HERE!!! COALESCE(A.INTER_SCF_EXCL_IND ,'T') <> COALESCE(B.INTER_SCF_EXCL_IND ,

I'm so frustrated!

 

 

 

data QueryRules;
   infile datalines;
   input rule $70.;
   datalines;                      
NVL(A.INTER_SCF_EXCL_IND ,'T') <> NVL(B.INTER_SCF_EXCL_IND ,'T')
;

* Recodes to fix inconsistancies in Rule code so it will run on IBMs database and run using SAS instead of plsql ;
data QueryRules;
	set QueryRules;

	* SASs equiv of Oracles NVL function ;
	rule = tranwrd(rule,"NVL(", "COALESCE(");

run;

proc sql;
select trim(rule) into : rule_list separated by "#" from QueryRules;
quit;

%put HERE!!! &rule_list;

 


Accepted Solutions
Solution
‎06-28-2016 05:25 PM
Super User
Posts: 6,785

Re: Macro resolution help again

Posted in reply to buechler66

The problem is a little different this time ... but it is something you might be able to figure out.  Just in case you want to work on it with that clue, I've moved the answer further down on the screen.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The length of your variable is $70.  That's fine when you start out.  But when you replace NVL with COALESCE, you need a longer variable.

View solution in original post


All Replies
Regular Contributor
Posts: 212

Re: Macro resolution help again

Posted in reply to buechler66
And with regard to the "#", I've tried it with no quotes, and single and double quotes. Grr....
Solution
‎06-28-2016 05:25 PM
Super User
Posts: 6,785

Re: Macro resolution help again

Posted in reply to buechler66

The problem is a little different this time ... but it is something you might be able to figure out.  Just in case you want to work on it with that clue, I've moved the answer further down on the screen.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The length of your variable is $70.  That's fine when you start out.  But when you replace NVL with COALESCE, you need a longer variable.

Regular Contributor
Posts: 212

Re: Macro resolution help again

Posted in reply to Astounding

OMG!  I just wasn't even looking in that direction.  Thanks so much!

Super User
Posts: 23,774

Re: Macro resolution help again

Posted in reply to Astounding

@Astounding That's what the spoiler tag is for Smiley Happy The little guy hiding his face on the tool bar.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 337 views
  • 0 likes
  • 3 in conversation