Hi SAS users,
I need help with the below issue. proc_cd data is coming like 1234|2348 pipe delimited, and i need to check these values against excel entries ( Ex : '1234' ,'2346','5678').
I tried this below small example with hard coded manual entry values , it worked fine. But when i pass the variable names i am getting warning and 0 observations.
Works -
proc sql;
create table total as
select * from test b
where prxmatch("!(1234|2348)!i" , '1234' ,'2346') > 0
;
Quit;
Does not work -
proc sql;
create table total as
select * from test b
where prxmatch("!(proc_cd)!i" , &proc) > 0
;
Quit;
WARNING: Function PRXMATCH requires at most 2 argument(s). The extra one(s) will be ignored.
1.The first query cannot possible be valid as you have 3 parameters.
2.This might help:
proc sql;
create table TOTAL as
select * from TEST
where prxmatch(cats("!",PROC_CD,"!i") , VAR) > 0;
quit;
Parentheses are unneeded here.
The i modifier is unneeded too if you only have digits to test.
1.The first query cannot possible be valid as you have 3 parameters.
2.This might help:
proc sql;
create table TOTAL as
select * from TEST
where prxmatch(cats("!",PROC_CD,"!i") , VAR) > 0;
quit;
Parentheses are unneeded here.
The i modifier is unneeded too if you only have digits to test.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.