<?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 To prevent from editing SAS options in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276498#M269644</link>
    <description>Hi,

This is my requirment, we are working on set of macros which are interrelated to each other, and the initial program that executes sets the system options as required. Once done this will be deployed to the user end.
The user will be able to execute his own codes after initiating the session. 

To give the expected output in particular format, we need to make sure that the sas options are not changed during execution.


Is there any way that we can lock the options been set after the execution of the initial program. Kindly advice.

Thanks,
Mooovendhan Devaraj</description>
    <pubDate>Fri, 10 Jun 2016 13:45:14 GMT</pubDate>
    <dc:creator>DMoovendhan</dc:creator>
    <dc:date>2016-06-10T13:45:14Z</dc:date>
    <item>
      <title>To prevent from editing SAS options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276498#M269644</link>
      <description>Hi,

This is my requirment, we are working on set of macros which are interrelated to each other, and the initial program that executes sets the system options as required. Once done this will be deployed to the user end.
The user will be able to execute his own codes after initiating the session. 

To give the expected output in particular format, we need to make sure that the sas options are not changed during execution.


Is there any way that we can lock the options been set after the execution of the initial program. Kindly advice.

Thanks,
Mooovendhan Devaraj</description>
      <pubDate>Fri, 10 Jun 2016 13:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276498#M269644</guid>
      <dc:creator>DMoovendhan</dc:creator>
      <dc:date>2016-06-10T13:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: To prevent from editing SAS options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276508#M269645</link>
      <description>&lt;P&gt;Probably not. &amp;nbsp;Another approach would be to capture the original option settings, and then restore options to those original values as your macro begins to execute.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 14:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276508#M269645</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-10T14:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: To prevent from editing SAS options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276515#M269646</link>
      <description>&lt;P&gt;If a Macro or program requires specific options I would recommend making sure that they are available when needed. You can use the OPTSAVE procedure to capture a users options and OPTLOAD to set the options you need and then restore the users options after the options are no longer needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the OPTLOAD uses a dataset then your implementation of the preferred options would be calling the procedure with a dataset containing the options needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So your macros could contain code like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc optsave out=lib.useropts;run;&lt;/P&gt;
&lt;P&gt;Proc optload data=permlib.macroopts;run;&lt;/P&gt;
&lt;P&gt;&amp;lt;other macro code&amp;gt;&lt;/P&gt;
&lt;P&gt;Proc optload data=lib.useropts;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 14:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276515#M269646</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-10T14:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: To prevent from editing SAS options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276591#M269647</link>
      <description>&lt;P&gt;Look into using PROC OPTSAVE in the initial macro and then let the the other macro(s) use OPTSAVE/PROC COMPARE to determine if there have been changes and reset them using OPTLOAD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use this technique in macro where I want to preserve and reset the users options after I change them in my macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   /*------------------------------------------------------------------------*
    | Reset system options changed by the macro.
    *------------------------------------------------------------------------*/
   proc optsave out=&amp;amp;m._optsave2;
      run;
   proc compare noprint base=&amp;amp;m._optsave1 compare=&amp;amp;m._optsave2 outbase outnoequal out=&amp;amp;m._optchange;
      run;
   data _null_;
      set &amp;amp;m._optchange;
      if _N_ eq 1 then put 'NOTE: The following options are being reset to previous values.';
      put 'NOTE- ' (OPTNAME OPTVALUE)(=);
      run;
   proc optload data=&amp;amp;m._optchange(keep=optname optvalue);
      run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 18:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-prevent-from-editing-SAS-options/m-p/276591#M269647</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-06-10T18:53:34Z</dc:date>
    </item>
  </channel>
</rss>

