Hello,
I have a variable text that contains some parameters like Basophils (10^9/L) and it is displaying correctly when I open the SAS dataset but when I run proc freq or I use proc report it becomes Basophils (10/L).
Could you help?
Thanks a lot in advance.
Here is the proc report code I'm using.
What does the ^S= in your code mean? Did you define ^ as the ODS escape character?
Could that have an impact on the Basophil units?
If you want someone to test please provide a sample version of reportDSN (in the form of a data step that can be run to create it) that demonstrates the issue.
What does the ^S= in your code mean? Did you define ^ as the ODS escape character?
Could that have an impact on the Basophil units?
If you want someone to test please provide a sample version of reportDSN (in the form of a data step that can be run to create it) that demonstrates the issue.
Hi:
@Tom is exactly correct. You are using an ESCAPECHAR defined character for both style overrides and for variable values. This will not work as you envision. Here's code that proves that the Character value for ESCAPECHAR cannot be the same as what you use in data values.
data fakedata;
length text $50;
infile datalines dlm=',' dsd;
input roword text $;
datalines;
1,Some text with ~ (tilde)
2,Some text with # (pound)
3,Some text with ^ (caret)
;
run;
ods escapechar = '~';
ods rtf file='c:\temp\try_tilde.rtf';
proc report data=fakedata;
define roword / order;
define text / display '~{style[color=purple] The Text}';
title '1) Escapechar is tilde ';
run;
ods rtf close;
ods escapechar = '#';
ods rtf file='c:\temp\try_pound.rtf';
proc report data=fakedata;
define roword / order;
define text / display '#{style[color=purple] The Text}';
title '2) Escapechar is pound';
run;
ods rtf close;
ods escapechar = '^';
ods rtf file='c:\temp\try_caret.rtf';
proc report data=fakedata;
define roword / order;
define text / display '^{style[color=purple] The Text}';
title '3) Escapechar is caret';
run;
ods rtf close;
If you run that code, you'll see that what is visible in the data can be impacted by the value you set for ODS ESCAPECHAR.
Cynthia
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.