BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AdamR
Fluorite | Level 6

Hello,

We're having issues removing tabs from our data as after the data massage the export into an Excel file is Unreadable and it's mostly caused by users entering a tab character in the software.

 

We've tried the following and others without any success:

 

PROJECT_NOTES=compress(PROJECT_NOTES,' ',s);

 

In the quotes is a tab. Removing the tab or replacing it with a space is OK.

Thoughts?

 

Adam

SAS 9.3

1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

You can also use TRANWRD() function to replace tab with a space tranwrd(string,'09'x,' ')

Thanks,
Suryakiran

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

To remove tabs I would say:

project_notes=compress(project_notes,'09'x);
FreelanceReinh
Jade | Level 19

@AdamR wrote:

We've tried the following and others without any success:

 

PROJECT_NOTES=compress(PROJECT_NOTES,' ',s);

 

In the quotes is a tab. Removing the tab or replacing it with a space is OK.

 


 

Hello @AdamR,

 

The modifier in the third argument of COMPRESS must be a character expression, i.e. 's' (unless s is a character variable containing the string 's' or 'S' etc.). With this correction the COMPRESS function should remove tabs ('09'x) and a few other "space characters" regardless what's in the quotes in the second argument.

SuryaKiran
Meteorite | Level 14

You can also use TRANWRD() function to replace tab with a space tranwrd(string,'09'x,' ')

Thanks,
Suryakiran

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 10816 views
  • 1 like
  • 4 in conversation