BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jagadishkatam
Amethyst | Level 16

Alternatively without the perl regular expressions

 

data want;
input text&:$500.;
text2=tranwrd(tranwrd(lowcase(text),'address','|'),'postcode','#');
housenumber=scan(scan(lowcase(strip(text2)),2,'|'),1,' ');
postcode=upcase(scan(lowcase(strip(text2)),2,'#'));
cards;
FULLNAMEMackenzie M. ThompsonADDRESS60 Boroughbridge RoadTOWNBIRKHALLPOSTCODEAB35 3LW
FULLNAMEEvelyn F. HillADDRESS18 St James BoulevardTOWNHORSEBROOKPOSTCODEST19 5EQ
FULLNAMEElise R. HayADDRESS15 Sloe LaneTOWNCROSTHWAITEPOSTCODELA8 6TP
FULLNAMEAntonia M. HendersonADDRESS3 Exning RoadTOWNHARLEYHOLMPOSTCODEML12 2JZ
;
Thanks,
Jag

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 17 replies
  • 3010 views
  • 0 likes
  • 3 in conversation