Help using Base SAS procedures

string manipulation (deleting underscores)

Reply
Contributor
Posts: 47

string manipulation (deleting underscores)

Hi all,

I have a macro variable say 'a' and usually has the string of type 'gross_combined_ratio'.

my question is how do you delete the underscore and replace it with a space. so that the string looks like 'gross combined ratio'

Thanks,
Sachin
p.s. sorry if this isnt the correct sub forum
New Contributor
Posts: 3

Re: string manipulation (deleting underscores)

Hi Sachin,

Is this what you were after?

%let a=gross_combined_ratio;
%let a=%sysfunc(translate(&a,%str( ),%str(_)));
%put _user_;

Cheers,
Michelle
Contributor
Posts: 47

Re: string manipulation (deleting underscores)

yep. thanks heaps Smiley Very Happy

sachin
Ask a Question
Discussion stats
  • 2 replies
  • 116 views
  • 0 likes
  • 2 in conversation