<?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 error: in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664744#M198642</link>
    <description>&lt;P&gt;You repeat the path in the %INCLUDE statement. I would start with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = C:\Users\jasti\OneDrive\Desktop\Sdtm\;
%include "&amp;amp;path.DS.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that does not do it, please post the %INCLUDE statement that worked before you used the macro variable.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2020 19:04:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-06-24T19:04:04Z</dc:date>
    <item>
      <title>%include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664738#M198636</link>
      <description>&lt;P&gt;I was trying to create a SDTM Domain using macros. I wanted to give a permanent path to store. I use %let path = "Locaton of the path";&lt;/P&gt;&lt;P&gt;and then %include "&amp;amp;path\Location of the path";&lt;/P&gt;&lt;P&gt;and i get an error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;7 option mprint mlogic symbolgen source source2;&lt;BR /&gt;8 %let path = C:\Users\jasti\OneDrive\Desktop\Sdtm\DS;&lt;BR /&gt;9 %include "&amp;amp;path/C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas";&lt;BR /&gt;SYMBOLGEN: Macro variable PATH resolves to C:\Users\jasti\OneDrive\Desktop\Sdtm\DS&lt;BR /&gt;WARNING: Physical file does not exist, C:\Users\jasti\OneDrive\Desktop\Sdtm\DS\C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas.&lt;BR /&gt;ERROR: Cannot open %INCLUDE file C:\Users\jasti\OneDrive\Desktop\Sdtm\DS/C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just started learning&amp;nbsp; macros. I know i am doing dumb wrong here. Can anyone help me where am going wrong in giving the path ?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option mprint mlogic symbolgen source source2;
%let path = C:\Users\jasti\OneDrive\Desktop\Sdtm\DS;
%include "&amp;amp;path/C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This was the only code i started with and got error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 18:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664738#M198636</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2020-06-24T18:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664741#M198639</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR:&lt;/STRONG&gt;&lt;/FONT&gt; Cannot open %INCLUDE file &lt;FONT color="#008080"&gt;&lt;STRONG&gt;C:\Users\jasti\OneDrive\Desktop\Sdtm\DS/&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Look at your error and look at what you coded. It literally takes the path and puts it where you have &amp;amp;path so it becomes the statement above. This is not valid SAS code. That's the key to making macros initially - treat it as basic text/code generation and the code must be valid SAS code. So if you remove one of the paths below it will work, either the macro variable or the path that you've hard coded. You only need one.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = C:\Users\jasti\OneDrive\Desktop\Sdtm\DS;
%include "&amp;amp;path/C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2020 18:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664741#M198639</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-24T18:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664742#M198640</link>
      <description>&lt;P&gt;In your code, you're calling the path twice (once in the macro variable &amp;amp;path, once in the typed-out path). The two paths are being concatenated, which produces a non-existent path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WARNING: Physical file does not exist, C:\Users\jasti\OneDrive\Desktop\Sdtm\DS\C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas.
ERROR: Cannot open %INCLUDE file &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;C:\Users\jasti\OneDrive\Desktop\Sdtm\DS&lt;/FONT&gt;&lt;FONT color="#0000FF"&gt;/C:\Users\jasti\OneDrive\Desktop\Sdtm\DS.sas&lt;/FONT&gt;&lt;/STRONG&gt;.&lt;/PRE&gt;
&lt;P&gt;Try changing your %include line to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "&amp;amp;path\DS.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664742#M198640</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-06-24T19:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664743#M198641</link>
      <description>&lt;P&gt;Look at the path that gets generated:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;WARNING: Physical file does not exist, &lt;FONT color="#FF0000"&gt;C:\Users\jasti\OneDrive\Desktop\Sdtm\DS&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;\C:\Users\jasti\OneDrive\Desktop\Sdtm\&lt;/FONT&gt;DS.sas.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Would your code eventually work if you just use the &amp;amp;path macro variable?&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;%include "&amp;amp;path\DS.sas";&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664743#M198641</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-06-24T19:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664744#M198642</link>
      <description>&lt;P&gt;You repeat the path in the %INCLUDE statement. I would start with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = C:\Users\jasti\OneDrive\Desktop\Sdtm\;
%include "&amp;amp;path.DS.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that does not do it, please post the %INCLUDE statement that worked before you used the macro variable.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664744#M198642</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-24T19:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664769#M198658</link>
      <description>&lt;P&gt;Assuming that the file really does exist, you just need to spell it correctly.&amp;nbsp; Change the "/" to "\".&amp;nbsp; Then this combination would work (but would be somewhat confusing):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = C:\Users\jasti\OneDrive\Desktop\Stdm\DS;&lt;BR /&gt;%include "&amp;amp;path..sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This would be more straightforward:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = C:\Users\jasti\OneDrive\Desktop\Stdm;
%include "&amp;amp;path\DS.sas";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2020 20:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664769#M198658</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-06-24T20:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664800#M198665</link>
      <description>Thank you all for really explaining it in depth and providing possible solutions. I resolved it !</description>
      <pubDate>Wed, 24 Jun 2020 22:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/664800#M198665</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2020-06-24T22:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: %include error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/665046#M198776</link>
      <description>Please select an answer and mark this question as solved.</description>
      <pubDate>Thu, 25 Jun 2020 15:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/include-error/m-p/665046#M198776</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-25T15:29:54Z</dc:date>
    </item>
  </channel>
</rss>

