BookmarkSubscribeRSS Feed
bian123
Calcite | Level 5

Hi,

This is my first post so apologies if it is in the wrong place or incorrect in some way.

I assigned a libname to an excel workbook like this:

libname temp EXCEL "&workbook." dbmax_text=32767 getnames = no;

Some variables have large spaces in their values due to the fact that once cell in my excel workbook may have multiple lines split apart by some kind of newline character.

I removed these using the following code in a datastep:

variable= compress(variable,,"kw");

However I was wondering if anyone knew a specific string of characters I could search for as it would help me achieve my programming goal - I want to replace these characters with a space.

Thanks,

I hope someone can help

P.S. I use windows

2 REPLIES 2
evp000
Quartz | Level 8

You may find the NOTPRINT function helpful.  You can find the location of non-printing characters and replace them with blanks.

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

There are also other threads on this forum for the same issue.

Ksharp
Super User

You could check

'0D0A'x

'0A'x

or just

put a $hex.;

to see what exactly it is .

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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