BookmarkSubscribeRSS Feed
varshabansal
Obsidian | Level 7

Hello everyone!

 

I want to remove extra space my text. how to remove that 

output is like this Fsc_acount_dim            .sas  

but i want to be it as fsc_account_dim.sas

 

Thanks in advance!

image.png

5 REPLIES 5
TarunKumar
Pyrite | Level 9
Use compress function
varshabansal
Obsidian | Level 7
use compress getting compress(name .sas)
PaigeMiller
Diamond | Level 26

@varshabansal wrote:
use compress getting compress(name .sas)

I don't know what this means.

--
Paige Miller
Kurt_Bremser
Super User

You cannot use a data step function like that in macro statements. You have to wrap data step functions into a %SYSFUNC call.

But a simple %LET will automatically strip leading and trailing blanks, so this will do:

%let nam=&name.;

if (and that can be a big IF) you really have blanks (hex 20). Other "whitespace" characters are not filtered.

 

In the future, use the proper forum windows (</> and "little running man") to copy/paste the log or program text into. Pictures make it hard for us to use code for testing, or to point out mistakes or places for improvement.

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
  • 5 replies
  • 590 views
  • 0 likes
  • 4 in conversation