BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASAna
Quartz | Level 8

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 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

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.

 

 

 

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

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.

 

 

 

SASAna
Quartz | Level 8
Thank you ! it worked very well.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 751 views
  • 0 likes
  • 2 in conversation