<?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: %include with &amp;sysparm in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70468#M15250</link>
    <description>Set a SAS macro variable (using a %LET statement) and use that macro variable in your included program.  You may also need/want to use a %GLOBAL statement from within your included program, if it does not always expect the macro variable to be set to some non-blank value.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
pass parameters to program site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
global macro variables site:sas.com</description>
    <pubDate>Wed, 09 Feb 2011 14:15:11 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2011-02-09T14:15:11Z</dc:date>
    <item>
      <title>%include with &amp;sysparm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70467#M15249</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I wanted to know if we could pass parameters to the SAS program which we use in %include statement using the sysparm option.&lt;BR /&gt;
&lt;BR /&gt;
If so.. Could you please tell me how do we do it?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Wed, 09 Feb 2011 09:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70467#M15249</guid>
      <dc:creator>Pramod_R</dc:creator>
      <dc:date>2011-02-09T09:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: %include with &amp;sysparm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70468#M15250</link>
      <description>Set a SAS macro variable (using a %LET statement) and use that macro variable in your included program.  You may also need/want to use a %GLOBAL statement from within your included program, if it does not always expect the macro variable to be set to some non-blank value.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
pass parameters to program site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
global macro variables site:sas.com</description>
      <pubDate>Wed, 09 Feb 2011 14:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70468#M15250</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-02-09T14:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: %include with &amp;sysparm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70469#M15251</link>
      <description>&amp;gt; Hi,&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I wanted to know if we could pass parameters to the&lt;BR /&gt;
&amp;gt; SAS program which we use in %include statement using&lt;BR /&gt;
&amp;gt; the sysparm option.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; If so.. Could you please tell me how do we do it?&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks in advance.&lt;BR /&gt;
&lt;BR /&gt;
-sysparm&lt;BR /&gt;
is loaded as SAS starts&lt;BR /&gt;
On win and unix platforms (but not on z/OS, iirc ) you can establish additional parameters in the invocation line&lt;BR /&gt;
"path/sas.exe" -sysin your.prog.sas -set extra "additional_code.sas" -sysparm "what ever" &lt;BR /&gt;
within your main program (named your.prog.sas above) you would add &lt;BR /&gt;
%include !extra /source2 ;&lt;BR /&gt;
then program "additional_code.sas" would be included.&lt;BR /&gt;
Of course you could add it to the sysparm string, but then you will need to parse it out of that string if you use the sysparm for any other purpose.&lt;BR /&gt;
When running on zOS you would need to provide the value in sysparm as sas is invoked. Your local methods for starting sas on z/OS may (normall) be different, so ask other sas programmers or an administrator.&lt;BR /&gt;
Once SAS has started &amp;amp;sysparm is like any other macro variable, so expect to use %substr() or %scan() to extract the program name, into macro variable (for example) extra. Then just&lt;BR /&gt;
%include "&amp;amp;extra" /source2 ;&lt;BR /&gt;
If the additional program is the only thing in sysparm, then no scan or substr is needed, just&lt;BR /&gt;
%include "&amp;amp;sysparm" /source2 ;&lt;BR /&gt;
 &lt;BR /&gt;
I'm recommending the /source2 option for the %include because it not only shows the lines of code included, but also shows the full external path and file name, which I find reassuring!&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Thu, 10 Feb 2011 10:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-with-sysparm/m-p/70469#M15251</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-10T10:57:49Z</dc:date>
    </item>
  </channel>
</rss>

