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
SAS Super FREQ

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
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 978 views
  • 0 likes
  • 2 in conversation