I am writing a macro to help create documentation which must use ods escapechar. I need it to preserve whatever options/setting the original program used. However, setting a new escape character in the macro overwrites the original program's escape character. How can I change the escape character only for the duration of my macro?
Is there a table somewhere in SAS which stores the current ods escapechar? My thought is to assign the current value to a macro variable and use that to reassign it once my process is complete.
2 Answers
Use the escape sequence instead
(*ESC*) Then you don't have to know or reset anything.
1Somewhere around 9.3 (?) they added &SYSODSescapeChar:
%put &=SYSODSescapeChar ; SYSODSESCAPECHAR=^ But since the generic (*ESC*) mentioned by data_null_ came first, I'm in the habit of using that, rather than do the save option / reset option / restore saved option dance.