<?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: SAS skips %include statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674652#M203169</link>
    <description>&lt;P&gt;Look into your included files. I suspect program2 has a comment at the end without the closing */, or unbalanced quotes.&lt;/P&gt;
&lt;P&gt;When you run them one by one, the "magic statement string" sent by your client (Studio or Enterprise Guide) after the code often manages to clean this up.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Aug 2020 05:48:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-08-05T05:48:58Z</dc:date>
    <item>
      <title>SAS skips %include statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674646#M203167</link>
      <description>&lt;P&gt;Hello! I have a program that begins by bringing in four separate SAS programs using %INCLUDE&amp;nbsp; {all separate import programs - bringing in data} and then is followed by some proc sql steps. So it looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%INCLUDE 'filepathprogram1' ;&lt;/P&gt;&lt;P&gt;%INCLUDE 'filepathprogram2' ;&lt;/P&gt;&lt;P&gt;%INCLUDE 'filepathprogram3' ;&lt;/P&gt;&lt;P&gt;%INCLUDE 'filepathprogram4' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table {using the data from the above files....}&lt;/P&gt;&lt;P&gt;etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;______________________________________________&lt;/P&gt;&lt;P&gt;When I run the program as a whole, only the first two include statements run and then SAS skips filepath programs 3 and 4, and just moves onto the proc sql step {which won't work because it hasn't brought in all the data needed from filepaths 3 and 4}. However, if I run this line by line (so if I run include statement 1, then 2, then 3, then 4), then the rest of the program works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason for this? Is there a limit to how many include statements I run at once? I thought they ran sequentially so it would not matter? Any more information to help me debug this would be helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 04:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674646#M203167</guid>
      <dc:creator>Krysia24</dc:creator>
      <dc:date>2020-08-05T04:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS skips %include statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674652#M203169</link>
      <description>&lt;P&gt;Look into your included files. I suspect program2 has a comment at the end without the closing */, or unbalanced quotes.&lt;/P&gt;
&lt;P&gt;When you run them one by one, the "magic statement string" sent by your client (Studio or Enterprise Guide) after the code often manages to clean this up.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 05:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674652#M203169</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-05T05:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS skips %include statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674759#M203218</link>
      <description>&lt;P&gt;So far I'm not noticing anything obvious but I'll keep looking through those codes. I should note I made a mistake when I wrote the original post: SAS runs filepaths 1 and 3 and skips over 2 and 4.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 16:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674759#M203218</guid>
      <dc:creator>Krysia24</dc:creator>
      <dc:date>2020-08-05T16:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS skips %include statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674764#M203222</link>
      <description>&lt;P&gt;This approach should work fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you set options NOSOURCE2 and then run the whole program, what does the log show for the four %include statements? Can you post the log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like Kurt's guess that it's likely a problem in one of the %include files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could always try brute force:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make four separate files file1.sas with just the code %put file1.sas running; and similar for file2.sas file3.sas file4.sas.&lt;/LI&gt;
&lt;LI&gt;Make a driver program that %includes all four files, in sequence just like your real program.&amp;nbsp; Run the driver program and get it to work and print the four %PUT statements to the log.&lt;/LI&gt;
&lt;LI&gt;Change the first %include from %including file1.sas to %include your real first file.&amp;nbsp; Re-run the driver and make sure all four %includes still work.&lt;/LI&gt;
&lt;LI&gt;Then continue add your real files one at a time and testing after each, until it breaks.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;That could help identify which file is problematic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 16:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674764#M203222</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2020-08-05T16:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS skips %include statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674784#M203236</link>
      <description>Thank you! It did end up being a sneaky comment that I didn't see at first.</description>
      <pubDate>Wed, 05 Aug 2020 17:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-skips-include-statements/m-p/674784#M203236</guid>
      <dc:creator>Krysia24</dc:creator>
      <dc:date>2020-08-05T17:02:52Z</dc:date>
    </item>
  </channel>
</rss>

