<?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 can I plug in %include statement inside the data step? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/can-I-plug-in-include-statement-inside-the-data-step/m-p/83625#M18050</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is this legal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.cars;&lt;/P&gt;&lt;P&gt;%include 'c:\data\var1.sas';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested it, it returns the result, but I don't know if it the right way to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Apr 2012 15:18:48 GMT</pubDate>
    <dc:creator>ZRick</dc:creator>
    <dc:date>2012-04-14T15:18:48Z</dc:date>
    <item>
      <title>can I plug in %include statement inside the data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-I-plug-in-include-statement-inside-the-data-step/m-p/83625#M18050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is this legal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.cars;&lt;/P&gt;&lt;P&gt;%include 'c:\data\var1.sas';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested it, it returns the result, but I don't know if it the right way to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2012 15:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-I-plug-in-include-statement-inside-the-data-step/m-p/83625#M18050</guid>
      <dc:creator>ZRick</dc:creator>
      <dc:date>2012-04-14T15:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: can I plug in %include statement inside the data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-I-plug-in-include-statement-inside-the-data-step/m-p/83626#M18051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the only restriction is that you include complete statements, not partial statements. You cannot do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if x &amp;gt; 0 then %include 'myFile.sas";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That doesn't work. But you can do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if x&amp;gt;0 then do;&lt;/P&gt;&lt;P&gt;%include "myFile.sas";&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you must remember that the inclusion will occur even if x &amp;lt;= 0. The do block will not be executed, but the code from myFile.sas will be included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2012 16:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-I-plug-in-include-statement-inside-the-data-step/m-p/83626#M18051</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-14T16:31:39Z</dc:date>
    </item>
  </channel>
</rss>

