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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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