<?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: Macro help needed for &amp;quot;operating environment variable&amp;quot;? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201566#M266832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the built in macro function %SYSGET() instead of trying use %SYSFUNC() to call the data step function SYSGET().&lt;/P&gt;&lt;P&gt;%let store_id=%sysget(STORE_ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also try using a PIPE to read the output of an echo command, but that would not be operating system independent and requires that PIPE engine access is allowed.&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'echo $STORE_ID' pipe;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt; call symputx('store_id',_infile_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember that on Unix environment variable names are case sensitive so STORE_ID is a different variable than store_id.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Aug 2015 12:27:44 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-08-18T12:27:44Z</dc:date>
    <item>
      <title>Macro help needed for "operating environment variable"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201565#M266831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAS Folks, The following part of my existing Retail Datawarehouse SAS script in production throws an error/warning when executed as mentioned below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let STORE_ID=%sysfunc(sysget(STORE_ID));&lt;/P&gt;&lt;P&gt;%put &amp;amp;STORE_ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOG Message:&lt;/P&gt;&lt;P&gt;WARNING: An argument to the function SYSGET referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system runs on Unix environment where basically a shell script executes the underlying SAS scripts. I am finding it dificult to understand the concept of operating variable as I read through the documentation for sysget function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245954.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245954.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above link, i noticed this point-"If the value of the operating environment variable is truncated or the variable is not defined in the operating environment, SYSGET displays a warning message in the SAS log."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please kindly advice a fix to my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 12:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201565#M266831</guid>
      <dc:creator>Allaluiah</dc:creator>
      <dc:date>2015-08-18T12:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help needed for "operating environment variable"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201566#M266832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the built in macro function %SYSGET() instead of trying use %SYSFUNC() to call the data step function SYSGET().&lt;/P&gt;&lt;P&gt;%let store_id=%sysget(STORE_ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also try using a PIPE to read the output of an echo command, but that would not be operating system independent and requires that PIPE engine access is allowed.&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'echo $STORE_ID' pipe;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt; call symputx('store_id',_infile_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember that on Unix environment variable names are case sensitive so STORE_ID is a different variable than store_id.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 12:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201566#M266832</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-18T12:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help needed for "operating environment variable"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201567#M266833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Tom Thank you, I will try sincerely. Please accept my apologies for the duplication here and in SAS L.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 12:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-needed-for-quot-operating-environment-variable-quot/m-p/201567#M266833</guid>
      <dc:creator>Allaluiah</dc:creator>
      <dc:date>2015-08-18T12:34:30Z</dc:date>
    </item>
  </channel>
</rss>

