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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1017 views
  • 0 likes
  • 2 in conversation