<?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: &amp;amp;SYSINCLUDEFILEDIR in a macro program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/amp-SYSINCLUDEFILEDIR-in-a-macro-program/m-p/682207#M206491</link>
    <description>&lt;P&gt;Yes, that's how it is. These two variables are empty inside macros. The easy way out is probably to put the two variables in another macro variable, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let filepath=&lt;SPAN&gt;&amp;amp;SYSINCLUDEFILEDIR/&amp;amp;SYSINCLUDEFILENAME;&amp;nbsp;/*&amp;nbsp;This&amp;nbsp;is&amp;nbsp;in&amp;nbsp;the&amp;nbsp;top&amp;nbsp;of&amp;nbsp;the&amp;nbsp;%include'd&amp;nbsp;program&amp;nbsp;*/&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can call the macro like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mc_get_prog_info_inc(&amp;amp;filepath);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You already got one solution for this, &lt;A href="https://communities.sas.com/t5/SAS-Programming/using-amp-SYSINCLUDEFILEDIR-and-amp-SYSINCLUDEFILENAME-in-a/m-p/665328#M198919" target="_self"&gt;earlier&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 11:38:50 GMT</pubDate>
    <dc:creator>s_lassen</dc:creator>
    <dc:date>2020-09-08T11:38:50Z</dc:date>
    <item>
      <title>&amp;SYSINCLUDEFILEDIR in a macro program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-SYSINCLUDEFILEDIR-in-a-macro-program/m-p/682185#M206482</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;in a including program; I have got a macro program that need a program name (and folder) as parameter.&lt;/P&gt;
&lt;P&gt;In a master program, I have an include of the including program and then I can call the macro by passing&amp;nbsp;&amp;amp;SYSINCLUDEFILEDIR/&amp;amp;SYSINCLUDEFILENAME .&lt;/P&gt;
&lt;P&gt;like this %&lt;STRONG&gt;&lt;I&gt;mc_get_prog_info_inc&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;SYSINCLUDEFILEDIR/&amp;amp;SYSINCLUDEFILENAME); and It works.I mean the &amp;amp;SYSINCLUDEFILEDIR/&amp;amp;SYSINCLUDEFILENAME contains the correct name of the including program.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;But in the including program, if i try to call the macro in another macro like this:&lt;/P&gt;
&lt;P&gt;%let test=1;&lt;/P&gt;
&lt;P&gt;%macro test;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;test=1 %then do ;&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;mc_get_prog_info_inc&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;SYSINCLUDEFILEDIR/&amp;amp;SYSINCLUDEFILENAME);&lt;/P&gt;
&lt;P&gt;%end ;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;%test ;&lt;/P&gt;
&lt;P&gt;it does not work. i mean &amp;amp;SYSINCLUDEFILEDIR and &amp;amp;SYSINCLUDEFILENAME&amp;nbsp;are empty !&lt;/P&gt;
&lt;P&gt;thanks in advance for your help&lt;/P&gt;
&lt;P&gt;regards&lt;/P&gt;
&lt;P&gt;Nasser&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;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 10:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-SYSINCLUDEFILEDIR-in-a-macro-program/m-p/682185#M206482</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2020-09-08T10:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;SYSINCLUDEFILEDIR in a macro program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-SYSINCLUDEFILEDIR-in-a-macro-program/m-p/682207#M206491</link>
      <description>&lt;P&gt;Yes, that's how it is. These two variables are empty inside macros. The easy way out is probably to put the two variables in another macro variable, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let filepath=&lt;SPAN&gt;&amp;amp;SYSINCLUDEFILEDIR/&amp;amp;SYSINCLUDEFILENAME;&amp;nbsp;/*&amp;nbsp;This&amp;nbsp;is&amp;nbsp;in&amp;nbsp;the&amp;nbsp;top&amp;nbsp;of&amp;nbsp;the&amp;nbsp;%include'd&amp;nbsp;program&amp;nbsp;*/&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can call the macro like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mc_get_prog_info_inc(&amp;amp;filepath);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You already got one solution for this, &lt;A href="https://communities.sas.com/t5/SAS-Programming/using-amp-SYSINCLUDEFILEDIR-and-amp-SYSINCLUDEFILENAME-in-a/m-p/665328#M198919" target="_self"&gt;earlier&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 11:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-SYSINCLUDEFILEDIR-in-a-macro-program/m-p/682207#M206491</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-09-08T11:38:50Z</dc:date>
    </item>
  </channel>
</rss>

