sas >> Remove special characters from SAS dataset

by vikram.vaidyanathan » Tue, 22 Apr 2008 10:31:56 GMT

I have a SAS dataset which shows special characters when viewed in UNIX
using the following command:

strings medadmin.sas7bdat | cat =96et|more =96f

You will see the following characters in between observations:

It is like there are 3 extra lines in the datasets and it needs to be

Can someone provide some insight on how to remove these special characters?


sas >> Remove special characters from SAS dataset

by RolandRB » Tue, 22 Apr 2008 15:08:55 GMT

On Apr 22, 4:31m, XXXX@XXXXX.COM (Vikram

Be very careful. Although these special characters might be seen using
a Unix command, all the actual fields might be OK. Don't forget that a
number stored in sas that is a number and not a character will
normally contain non-printable characters that this Unix command will
also show up. And yet the dataset might be perfectly OK.

If you want to scan the *character* fields for strange characters that
maybe should not be there then use my macro.

It calls other macros that you can find on my web site.

Similar Threads

1. creating a permanent sas dataset with obseravtions removed from the original sas dataset

2. Special Characters in TEXT of the SAS program


I need to put some special characters, specifically, subscript and <= &
>= signs in the text of my program.

I have tried pasting characters from the character map but it works
some times and doesn't work at other time , probably because of the
format in which the characters are saved.

Does anyone know of an option in SAS that can let me insert these

Please help.

Thanks !

3. Preserving special characters when sending parameters to SAS/IntrNet

4. Preserving special characters when sending parameters to SAS/IntrNet

5. Email option for removing stray characters from SAS-L posts

6. How to remove special string


 2 quick questions.

1. How to declare a variable? For example, declare x=numeric6.2 
 Is it using put or input?
2. How to remove all occurence of the symbol ' and the symbol "
Tranwrd in SAS won't take ' or " 

companyname=John's "R" Shop
desiredoutput=Johns R Shop

--- news:// - complaints:  XXXX@XXXXX.COM  ---

7. changing character dataset into numeric dataset?

8. stack a 'numeric' dataset to a 'character' dataset??

Hello, Please please help me on this data merge problem. --Tina

Dataset 1 has the variables' names: 1 observation, 111 columns

col1 col2 col3......col111

Dataset 2 has the variables' values: 1000 observations, 111 columns

var1 var2 var3 var4 var5 var6......var111
123  234  345   12  2008 67.........1200000

How to just stack these two datasets and generate a new dataset which
include the variable names as the var1-111? New dataset still has 1000
obs and 111 columns but the variable names are changed to SYSTEM DIST
etc. etc.

123  234  345   12  2008 67.........1200000

It is like renaming var1 to var111 in dataset2 into SYSTEM DIST ASSOC
MONTH YEAR, etc? which merging method is not sensitive to variable

Thank you very much, do appreciate the help I always get from here.