The SAS Output Delivery System and reporting techniques

ODS is removing special characters (please make it stop)

Reply
Senior User
Posts: 1

ODS is removing special characters (please make it stop)

 

Hi,

I'm trying to output a simple frequency using ODS.  Either ODS or Excel is removing special characters in the field.

 

The SAS output window clearly displays the text "MCLab RO MAIN Campus^24D0404292^CLIA" with the hat character, but when I output it using ODS (either HTML or EXCEL), the hat characters are removed "MCLab RO MAIN CampusD0404292CLIA".

 

I would like for the ODS output to reflect exactly what is in the data.  How do I make it so that it does not remove the hat character in the ODS output?

 

Thanks for your help

Contributor
Posts: 44

Re: ODS is removing special characters (please make it stop)

[ Edited ]
Posted in reply to adrake513

Could this possibly be related to the ODS ESCAPECHAR option?  If that option specified the hat character, then ODS would treat that character as an escape character.  Perhaps that character is the default escape character in your environment.  Maybe try setting it to some other character that isn't in your data?

SAS Super FREQ
Posts: 9,431

Re: ODS is removing special characters (please make it stop)

Posted in reply to adrake513

Hi:

  I ran a little test and used that string for a label just with SASHELP.CLASS. I do not observe what you report. I see the caret/hat symbol being used in both ODS HTML and ODS EXCEL:

use_caret.png

 

I am running 9.4 M3. Is there any chance that you were using ODS ESCAPECHAR='^'; elsewhere in your code? I find that if I have ESCAPECHAR set to ^, then the caret symbols are stripped out of the text string. As a test, right before you PROC FREQ, you could try

ODS ESCAPECHAR='~';

 

and then see if your ^ symbol appears in the text.

 

cynthia

 

Ask a Question
Discussion stats
  • 2 replies
  • 160 views
  • 0 likes
  • 3 in conversation