DATA Step, Macro, Functions and more

Character Field Manipulations, Best Approach

Reply
Regular Contributor
Posts: 238

Character Field Manipulations, Best Approach

[ Edited ]

I just finished doing some slicing-and-dicing of a character field, using SAS built-in functions.  Involved many steps and seemed a lot more complicated than I would have guessed.

 

Just curious, do most advanced users here graduate to another approach to character field manipulation?

 

I see that SAS also allows using RegEx.  Would RegEx be a better approach to many character field manipulations?

 

Here is an example of one manipulation I was attempting:

 

Have:

rg1_23456a_7

 

Want:

34a

Thanks much.

 

Nicholas Kormanik

 

 

Super User
Posts: 24,012

Re: Character Field Manipulations, Best Approach

Posted in reply to NicholasKormanik

You need to show a rule and/or pattern. You can't extrapolate from a single data point. 

Ask a Question
Discussion stats
  • 1 reply
  • 110 views
  • 0 likes
  • 2 in conversation