SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1669 views
  • 0 likes
  • 4 in conversation