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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.