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;
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.
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.
OMG! I just wasn't even looking in that direction. Thanks so much!
@Astounding That's what the spoiler tag is for 🙂 The little guy hiding his face on the tool bar.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.