Catch current setting of "ods escapechar"

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

Catch current setting of "ods escapechar"

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


Accepted Solutions
Solution
‎08-20-2016 10:43 AM
SAS Super FREQ
Posts: 8,818

Re: Catch current setting of "ods escapechar"

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


All Replies
Solution
‎08-20-2016 10:43 AM
SAS Super FREQ
Posts: 8,818

Re: Catch current setting of "ods escapechar"

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

Contributor
Posts: 35

Re: Catch current setting of "ods escapechar"

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
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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