BookmarkSubscribeRSS Feed
adrake513
Calcite | Level 5

 

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

5 REPLIES 5
jmhorstman
Obsidian | Level 7

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?

Cynthia_sas
SAS Super FREQ

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

 

jimmy45
Calcite | Level 5

I just find another character '/' which cannot be displayed in column header of ods excel. It appears as a new line feed. Any solution?

Cynthia_sas
SAS Super FREQ

Hi:

  I do not observe that behavior, as shown below when using PROC PRINT or PROC REPORT:

Cynthia_sas_0-1611338406397.png

Since the / is the default split character in PROC REPORT, I did need to modify the split= option in my PROC REPORT code. But as you can see in the default HTML and in the ODS EXCEL output, I can see the / in the column headers.

 

Cynthia

jimmy45
Calcite | Level 5

thank you, Cynthia. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 5 replies
  • 2350 views
  • 1 like
  • 4 in conversation