<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SAS 9.3-Resetting to initial &amp;quot;ODS state&amp;quot; in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39182#M5430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have 9.3 yet but I would start by running PROC OPTIONS to see if any new ODS options are avaialble and then look in the online help at the automatic SYS variables to see if anything looks likely.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jul 2011 21:16:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2011-07-29T21:16:02Z</dc:date>
    <item>
      <title>SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39181#M5429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I imagine not many of you have 9.3 installed yet ... but as you may (or may not) be aware SAS 9.3 (in Windows at least) comes shipped so that the default output is to the HTML ODS destination and LISTING ODS destination is NOT active.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, what I'm wondering about is there a way via code to determine the initial state of active ODS destinations when a program is launched --- reason I ask is the program I'm working on right now activates a number of ODS destination (RTF and TAGSETS.EXCELXP for example), and turns off ODS LISTING (actually activates it periodically as well) ... but at the end of the program I had code to (ostensibly) return the user's environment to (hopefully) the same state in which it was before launching the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So currently, that part of the code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ODS _ALL_ CLOSE;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ODS LISTING;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ODS RESULTS ON;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which with SAS 9.2 I could be pretty sure that ODS LISTING was the default state ... before the program began. But in 9.3 that is not the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore, I have users that will run this program that will have 9.2 (and/)or 9.3 ... and therefore I need to re-set ODS destinations to the state before the program --- and hence I need to somehow get that information at program launch so I can use it to re-set at program end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clues as to how that might be accomplished?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks-&lt;EM&gt;Allen&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 20:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39181#M5429</guid>
      <dc:creator>AllenEBingham</dc:creator>
      <dc:date>2011-07-29T20:03:29Z</dc:date>
    </item>
    <item>
      <title>SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39182#M5430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have 9.3 yet but I would start by running PROC OPTIONS to see if any new ODS options are avaialble and then look in the online help at the automatic SYS variables to see if anything looks likely.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 21:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39182#M5430</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-07-29T21:16:02Z</dc:date>
    </item>
    <item>
      <title>SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39183#M5431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at: &lt;/P&gt;&lt;P&gt;&lt;SPAN class="xrefText" style="font-style: normal;"&gt;(see &lt;/SPAN&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/odsug/62755/HTML/default/p0xidv7ssklgg2n1lzf7u6wuei7z.htm#n0ls5a10i14o4gn1m94i1fvmk2jw" style="font-weight: normal; font-style: normal; font-size: 13px; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; text-align: left; text-decoration: underline; color: #0066cc;"&gt;How to Restore 9.2 Behavior&lt;/A&gt;&lt;SPAN class="xrefText" style="font-style: normal;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="xrefText" style="font-style: normal;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2011 01:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39183#M5431</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-30T01:26:51Z</dc:date>
    </item>
    <item>
      <title>SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39184#M5432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Query SASHELP.VDEST, e.g.:&lt;/P&gt;&lt;PRE&gt;proc print data=sashelp.vdest;run;&lt;/PRE&gt;&lt;P&gt;David Kelley, SAS &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 15:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39184#M5432</guid>
      <dc:creator>DavidK_SAS</dc:creator>
      <dc:date>2011-08-01T15:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39185#M5433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very useful --- but somewhat problematic to actually use in practice. When I launch a 'fresh' interactive session of SAS 9.2 or 9.3, sashelp.vdest has NO observations. So my 'workaround' to that issue (is to use the proc print to actually 'populate' VDEST) in some paired code --- the 1st part is at the beginning of my macro, and the second part is at the end:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;First part:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ods results off;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;proc print data=sashelp.vdest;run;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set sashelp.vdest;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; call symput('INIT_DEST',destination);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; call symput('INIT_STYL',style);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ODS &amp;amp;INIT_DEST CLOSE; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second part:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ODS &amp;amp;INIT_DEST style=&amp;amp;INIT_STYL;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ODS RESULTS ON;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with this code is that it seems to work just fine with 9.3 ... but with SAS 9.2 ... I get a Listing output in the output window of the contents of SASHELP.VDEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(It also assumes that there is only one active destination ... and it is the first one in VDEST)!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The interesting part of this that I'm wondering about it that SAS 9.2 nor 9.3 doesn't really have the Listing or HTML output active (i.e., VDEST has no obs when SAS initialized), but only has those active after 'asking' for some output (in this case via Proc Print). So really the code above is not necessarily setting things to their initial state, but seems to be as close as I can get (with my coding skills).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clue as to what I'm doing wrong that results in the proc print output going to the listing output window in 9.2 (seems to me the ods results off should have handled that ... and it appears to in 9.3)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks-&lt;EM&gt;Allen&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 16:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39185#M5433</guid>
      <dc:creator>AllenEBingham</dc:creator>
      <dc:date>2011-08-01T16:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39186#M5434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Allen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For SAS 9.2, by default, ODS Listing is on and ODS HTML is off.&amp;nbsp; For SAS 9.3, by default, ODS Listing is off and ODS HTML is on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here's a SAS 9.2 hack to force ODS Listing to be on prior to querying SASHELP.VDEST:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp; proc template; run;&lt;BR /&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp; This qualifies as a hack because there's no guarantee that it will work in future versions of SAS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- David Kelley, SAS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 16:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39186#M5434</guid>
      <dc:creator>DavidK_SAS</dc:creator>
      <dc:date>2011-08-01T16:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39187#M5435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks---worked perfectly!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW-I'll worry about future versions of SAS when I have to cross that bridge.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 17:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39187#M5435</guid>
      <dc:creator>AllenEBingham</dc:creator>
      <dc:date>2011-08-01T17:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.3-Resetting to initial "ODS state"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39188#M5436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I addressed the issue of more than one active ODS destinations in the following code ... and it appears to work 'great' in both 9.2 and 9.3 (the 1st two statements are just to set things up for testing on both versions):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing;&lt;BR /&gt;ods html;&lt;/P&gt;&lt;P&gt;%MACRO test;&lt;/P&gt;&lt;P&gt;/* Save all current system used in the macro for later re-setting to original state &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; GOPTIONS that are set in the macro are reset to the default system values only */&lt;/P&gt;&lt;P&gt;%let sopts=&lt;BR /&gt;%sysfunc(getoption(missing,keyword))&lt;BR /&gt;%sysfunc(getoption(center))&lt;BR /&gt;%sysfunc(getoption(xwait))&lt;BR /&gt;%sysfunc(getoption(xsync))&lt;BR /&gt;%sysfunc(getoption(date))&lt;BR /&gt;%sysfunc(getoption(papersize,keyword))&lt;BR /&gt;%sysfunc(getoption(bottommargin,keyword))&lt;BR /&gt;%sysfunc(getoption(topmargin,keyword))&lt;BR /&gt;%sysfunc(getoption(rightmargin,keyword))&lt;BR /&gt;%sysfunc(getoption(leftmargin,keyword))&lt;BR /&gt;%sysfunc(getoption(orientation,keyword))&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;OPTIONS MPRINT;&lt;/P&gt;&lt;P&gt;/* Following launch of PROC TEMPLATE is to 'force' SASHELP.VDEST to have observations (if SAS just&lt;BR /&gt;&amp;nbsp;&amp;nbsp; initialized it would not have any values */&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set sashelp.vdest end=last;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call symput('INIT_DEST'||left(_n_),destination);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; call symput('INIT_STYL'||left(_n_),style);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if last then call symput('N_DEST',LEFT(_n_));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do I = 1 %to &amp;amp;N_DEST %by 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; ODS &amp;amp;&amp;amp;INIT_DEST&amp;amp;I CLOSE;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options noxwait xsync;&lt;/P&gt;&lt;P&gt;ods rtf file='test.rtf';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods results off;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;/* PUT CODE FOR MACRO HERE ... THAT VARIOUSLY USES A VARIETY OF ODS DESTINATIONS */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS _ALL_ CLOSE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Reset system options, etc. to starting values and goptions to system default values */&lt;/P&gt;&lt;P&gt;OPTIONS &amp;amp;SOPTS;&lt;BR /&gt;GOPTIONS reset=goptions;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;/* Reset ODS destinations to original values */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%do I = 1 %to &amp;amp;N_DEST %by 1; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; ODS &amp;amp;&amp;amp;INIT_DEST&amp;amp;I style=&amp;amp;&amp;amp;INIT_STYL&amp;amp;I;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS RESULTS ON;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%MEND test;&lt;/P&gt;&lt;P&gt;%TEST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 19:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-9-3-Resetting-to-initial-quot-ODS-state-quot/m-p/39188#M5436</guid>
      <dc:creator>AllenEBingham</dc:creator>
      <dc:date>2011-08-01T19:56:45Z</dc:date>
    </item>
  </channel>
</rss>

