BookmarkSubscribeRSS Feed
Beto16
Obsidian | Level 7
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




1 REPLY 1
Patrick
Opal | Level 21

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1 reply
  • 1166 views
  • 0 likes
  • 2 in conversation