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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1007 views
  • 0 likes
  • 2 in conversation