<?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 Re: Executing %sysget without generating an error? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101090#M21168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the "this" you're referring to above?&amp;nbsp; The suppression of the warning or the use of environment variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2013 02:28:52 GMT</pubDate>
    <dc:creator>ScottBass</dc:creator>
    <dc:date>2013-02-08T02:28:52Z</dc:date>
    <item>
      <title>Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101085#M21163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to either conditionally execute %sysget, or unconditionally execute it without causing a warning message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, with macro variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if (%symexist(foo)) %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if (&amp;amp;foo eq BAR) %then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put BAR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put BLAH;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, NOSERROR can come in handy sometimes to suppress warnings about unresolved macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, analogously:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %sysexist(foo) %then %do;&amp;nbsp; * the mythical %sysexist function ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let foo=%sysget(foo);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if (&amp;amp;foo eq BAR) %then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put BAR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put BLAH;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd kinda think a %sysexist function, paired with %sysget, would be a no-brainer for SAS by now???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 11:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101085#M21163</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-02-07T11:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101086#M21164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not to be too simplistic...but if you've set NOSERROR, then doesn't this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if "&amp;amp;foo"="BAR" %then %put BAR;&lt;/P&gt;&lt;P&gt;%else %put BLAH;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 12:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101086#M21164</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-07T12:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101087#M21165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you running SAS 9.3 ?&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Use SYSEXIST function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1kqfrj3pipbnwn12c6jyaztd1sh.htm" style="font-size: 10pt; line-height: 1.5em;" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1kqfrj3pipbnwn12c6jyaztd1sh.htm"&gt;SAS(R) 9.3 Functions and CALL Routines: Reference&lt;/A&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%macro foo;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; %if %sysfunc(sysexist(foo)) %then %do;&amp;nbsp; * the mythical %sysexist function ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let foo=%sysget(foo);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if (&amp;amp;foo eq BAR) %then&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put BAR;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put BLAH;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%mend foo;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 17:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101087#M21165</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-07T17:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101088#M21166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doh!&amp;nbsp; I guess I should read the "What's New in SAS 9.3" documentation!&amp;nbsp; I was looking under the macro documentation for %sysexist to pair up with %sysget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To SAS:&amp;nbsp; I do think %sysexist would be useful, to add "symmetry" to these functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Step:&lt;/P&gt;&lt;P&gt;symexist --&amp;gt; symget&lt;/P&gt;&lt;P&gt;sysexist --&amp;gt; sysget&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;P&gt;%symexist --&amp;gt; %symget doesn't make sense here, just reference the &amp;amp;macrovariable&lt;/P&gt;&lt;P&gt;%sysexist --&amp;gt; %sysget&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot Tom, I always appreciate your insights.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 21:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101088#M21166</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-02-07T21:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101089#M21167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just for my edification....Do you do this for programming efficiencies?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 21:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101089#M21167</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-07T21:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101090#M21168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the "this" you're referring to above?&amp;nbsp; The suppression of the warning or the use of environment variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 02:28:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101090#M21168</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-02-08T02:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Executing %sysget without generating an error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101091#M21169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that's what I was missing...these are environment variables...not macro variables...sorry for the confusion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 13:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-sysget-without-generating-an-error/m-p/101091#M21169</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-08T13:26:24Z</dc:date>
    </item>
  </channel>
</rss>

