<?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: WARNING: The argument to macro function %SYSGET is not defined as a system variable. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245087#M45693</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;: Yeah that is a user defined macro.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 21 Jan 2016 11:36:42 GMT</pubDate>
    <dc:creator>Aditi24</dc:creator>
    <dc:date>2016-01-21T11:36:42Z</dc:date>
    <item>
      <title>macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244906#M45684</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I have SAS 9.1.3 , 9.3 and 9.4(all three of them) installed on my Unix server. So I have an application which is used to submit batch programs to the remote SAS. Also, I can signon to any of the three versions and submit a batch to any of the three SAS version on the same UNIX server.&amp;nbsp;To choose the version I want to sumbit my batch on, I have given a radiobox control which has which has 3 radio buttons(See attached).&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;To get the above submission, I am using the following code:-&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;/* macro "sysver" gives the version of SAS currently connected to and sasver refers to the server I &lt;BR /&gt;want to submit batch on, based on which certain flags are getting modified*/

%if "&amp;amp;sysver"="9.1" and "&amp;amp;sasver"="sas93" or "&amp;amp;sasver"="sas94"                                                                                                                                                                                              
      %then %let flag_reset=1;                                                                                                                                                                                                                                  
    %else %if "&amp;amp;sysver"="9.3" or "&amp;amp;sysver"="9.4" and "&amp;amp;sasver"="sas"                                                                                                                                                                                            
       %then %let flag_reset=2;                                                                                                                                                                                                                                 
    %else  %let flag_reset=0; 

/* To submit batch from a lower version to higher, I am including TKPATH variable and assigning&lt;BR /&gt; it an empty string which will be later set to the tkpath*/                                                                                                                                                                                                                                                           
      %if &amp;amp;flag_reset=1 %then %do;                                                                                                                                                                                                                              
         %let tkpath=%sysget(TKPATH) ;                                                                                                                                                                                                                          
         options set=TKPATH "" ;                                                                                                                                                                                                                               
      %end; 
&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;So when I am signed on to SAS 9.3 or 9.4,I am getting a warning message as below:-&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;WARNING: The argument to macro function %SYSGET is not defined as a system variable.
&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Even if the statment (below) is inside a conditional construct which is never getting executed, it is prompting me the above warning message.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let tkpath=%sysget(TKPATH) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please suggest a method to either remediate this or get rid of the warning message.&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12215iA151073EC443C518/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Thu, 21 Jan 2016 13:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244906#M45684</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-01-21T13:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244910#M45685</link>
      <description>&lt;P&gt;Macro language is a code generation system. &amp;nbsp;It is always run, and always decomipled. &amp;nbsp;Basically the preprocessor is trying to sort out all the references before trying conditionals. &amp;nbsp;I would ask why your trying to do things this way. &amp;nbsp;Every version of SAS can have its own confirguration setup - autoexec.sas - which gets called when the SAS system starts up - in batch that can be in the same folder as the program, or on the install area. &amp;nbsp;This kind of setup code would be far better suited to be put in the setup autoexec.sas file for the individual installs, then you don't need to worry about all the code below or try to replicate what that is doing, you just add the necessary code into each autoexec.sas.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 09:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244910#M45685</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-21T09:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244929#M45688</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;: Thanks for getting a clear understanding of the issue I am stuck with but could you please elaborate on how and what to put in the autoexec.sas file. I am a noob in this area. Your suggestions will be very helpful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 21 Jan 2016 10:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244929#M45688</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-01-21T10:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244930#M45689</link>
      <description>&lt;P&gt;This depends on your setup/install. &amp;nbsp;You would need to check with your IT group where/how they have set it up. &amp;nbsp;Its called autoexec.sas, and if you run something in batch (if installed locally) then the autoexec can reside in the same directory, or it could be on the network drive that SAS is installed on. &amp;nbsp;Speak to whoever installed it, they should be able to show you where the install is and then you will see this file.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 10:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244930#M45689</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-21T10:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244990#M45690</link>
      <description>&lt;P&gt;autoexec.sas is a simple text file containing Base SAS code. So everything that works in a code window in EG or SAS Studio will work there.&lt;/P&gt;
&lt;P&gt;Code that needs to be done anytime a SAS session or batch job is started, should go in there.&lt;/P&gt;
&lt;P&gt;Depending on your setup, you can either use a (or the) global autoexec.sas, or you might be better off modifying a autoexec_usermods.sas file in your configuration path on the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 11:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244990#M45690</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-21T11:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244991#M45691</link>
      <description>Thank you so much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;. That makes it more clear.</description>
      <pubDate>Thu, 21 Jan 2016 11:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/244991#M45691</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-01-21T11:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245006#M45692</link>
      <description>&lt;P&gt;I also suspect you have a typo in there, as &amp;amp;sasver is not a defined automatic macro variable.&lt;/P&gt;
&lt;P&gt;Which makes me question the purpose of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if "&amp;amp;sysver"="9.1" and "&amp;amp;sasver"="sas93" or "&amp;amp;sasver"="sas94"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 11:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245006#M45692</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-21T11:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: The argument to macro function %SYSGET is not defined as a system variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245087#M45693</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;: Yeah that is a user defined macro.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 21 Jan 2016 11:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245087#M45693</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-01-21T11:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245188#M45723</link>
      <description>&lt;P&gt;On my Windows machine, I cannot replicate the warning message if the %LET statement using the %SYSGET function is not executed (because the %IF condition is not met). I conclude, that it &lt;EM&gt;is&lt;/EM&gt; executed in your case when you receive the warning message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the reason I suspect incorrect logic: Please note that your condition&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;sysver"="9.1" and "&amp;amp;sasver"="sas93" or "&amp;amp;sasver"="sas94"  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;could be rewritten as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;("&amp;amp;sysver"="9.1" and "&amp;amp;sasver"="sas93") or "&amp;amp;sasver"="sas94"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but it seems more plausible to me that it should read&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;sysver"="9.1" and ("&amp;amp;sasver"="sas93" or "&amp;amp;sasver"="sas94")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And similarly for the other condition&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;sysver"="9.3" or "&amp;amp;sysver"="9.4" and "&amp;amp;sasver"="sas"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, I would try to insert parentheses at the appropriate places.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 14:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/245188#M45723</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-01-21T14:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/248178#M46594</link>
      <description>&lt;P&gt;Thank you so much..that was a very silly error which was overlooked.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 07:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-error/m-p/248178#M46594</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-02-05T07:15:31Z</dc:date>
    </item>
  </channel>
</rss>

