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

Hello.
I want to know the way to catch current setting
of "ods escapechar" .

 

For example, when you examine the attributes of the data set,we can do it byby "PROC CONTENTS" .
I want this to "ODS escapechar".
Say,before I do "ods escapechar='^';",just I want to catch now or default setting of it.

 

For catch this info, I tried Google search with the words "get ods current setting sas",but it can't figure out it.
The following sites were first hit, but it was different content.
http://support.sas.com/kb/24/065.html
(Image is result of above URL's sample code, by SAS Studio)

kb_24_065

Thank you for your cooperation

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

HI:

  There are some ODS statements that are global in addition to ODS ESCAPECHAR (like ODS RESULTS and ODS PTITLE) and I do not believe there is a way to retrieve the current setting. That would be a question for Tech Support.

 

  But, even if you do not know what the current value of ESCAPECHAR is, you can always use (*ESC*) and it will work no matter what ESCAPECHAR has been set to. But, I consider it a best practice to either set a standard for ESCAPECHAR (always use ^) or to have the ODS ESCAPECHAR statement explicitly appear in your code.

 

  Try this:


ods escapechar='^';

title '1) use carat as the ^{dagger} symbol for ESCAPECHAR';
title3 '2) Use the special command as the (*ESC*){dagger} symbol for ESCAPECHAR';
proc print data=sashelp.class(obs=3);
run;
title;
footnote; 

And you will get the dagger in both TITLE statements beause of using (*ESC*) while ^ was the current ESCAPECHAR in effect.

 

cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
Diamond | Level 26

HI:

  There are some ODS statements that are global in addition to ODS ESCAPECHAR (like ODS RESULTS and ODS PTITLE) and I do not believe there is a way to retrieve the current setting. That would be a question for Tech Support.

 

  But, even if you do not know what the current value of ESCAPECHAR is, you can always use (*ESC*) and it will work no matter what ESCAPECHAR has been set to. But, I consider it a best practice to either set a standard for ESCAPECHAR (always use ^) or to have the ODS ESCAPECHAR statement explicitly appear in your code.

 

  Try this:


ods escapechar='^';

title '1) use carat as the ^{dagger} symbol for ESCAPECHAR';
title3 '2) Use the special command as the (*ESC*){dagger} symbol for ESCAPECHAR';
proc print data=sashelp.class(obs=3);
run;
title;
footnote; 

And you will get the dagger in both TITLE statements beause of using (*ESC*) while ^ was the current ESCAPECHAR in effect.

 

cynthia

t_ar_taat
Quartz | Level 8
Hi,Cynthia Thank you so much your quick response! It is first time for me to know "(*ESC*)" ! I actually run your code in SAS Studio and understand your answer well. Again,thank you!
result_Cynthia_code.JPG

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1858 views
  • 0 likes
  • 2 in conversation