DATA Step, Macro, Functions and more

Using Prxparse to pull 2 words at same time

Reply
Frequent Contributor
Posts: 80

Using Prxparse to pull 2 words at same time

Hi I have this code
Data have
Infile 'C:\users\desktop \night.csv' dlm='09' X dsd truncover;;
Input x $25000.;
Length Bacode $25;
N+1;
Pid = prxparse ("/atmbarcode:\W*\w+i');
S=1;
E=length (x);
Call prxnext (pid,s,e,x,p,l);


Do while (p>0),
Bacode =substr(x,possibly l);output;
Call prxnext (pid,s,e,xp,l);

End;
Keep n x bacode;
It pulls in id number it works I need to extract a 2ndword at same time here it is

Prxparse ('/RS [A-Z\d](15))|(?<=bagbarcode \W,POS-13,2),substr (x,POS-19,2));
RUN; HOW do I combine both prxparse to pull at same time? Thanks




Respected Advisor
Posts: 4,173

Re: Using Prxparse to pull 2 words at same time

Have a look into the example given for prxposn() 

http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n1lru1b4uoo...

 

If this doesn't work for you then please provide a data step creating the source string and describe how the desired result needs to look like.

Ask a Question
Discussion stats
  • 1 reply
  • 256 views
  • 0 likes
  • 2 in conversation