<?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 %include in PROC SQL? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31047#M7384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;probably.&amp;nbsp; Please share your log so we can see the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2011 02:01:56 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2011-10-19T02:01:56Z</dc:date>
    <item>
      <title>%include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31046#M7383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’d like to be able to include blocs of code within PROC SQL using %include statements.&amp;nbsp; But doing so generates error messages.&amp;nbsp; Is there some option or technique to accomplish this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 01:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31046#M7383</guid>
      <dc:creator>TedShelly</dc:creator>
      <dc:date>2011-10-19T01:26:21Z</dc:date>
    </item>
    <item>
      <title>%include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31047#M7384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;probably.&amp;nbsp; Please share your log so we can see the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 02:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31047#M7384</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-10-19T02:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: %include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31048#M7385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ... there maybe an easier way to do this, but you can turn the code you want to include into a macro variable ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* some SQL statements in an external file;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;file 'z:\stuff.txt';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;put 'from sashelp.class';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;put 'where sex eq "M"';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* create a macro variable from the statements in the external file;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;length stuff $1000;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;infile 'z:\stuff.txt' end=done;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;do until (done);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp; input;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp; stuff = catx(' ',stuff,_infile_);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;call symputx('stuff',stuff);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* "include" the statements using the macro variable;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;create table males as&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;select *&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;amp;stuff;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 02:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31048#M7385</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-10-19T02:12:50Z</dc:date>
    </item>
    <item>
      <title>%include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31049#M7386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all. %include is not a part of Macro facility. So you can put the code into SQL.&lt;/P&gt;&lt;P&gt;But you can make a macro to include these code and use macro to put the code into SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 02:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31049#M7386</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-10-19T02:42:43Z</dc:date>
    </item>
    <item>
      <title>%include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31050#M7387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&amp;nbsp; I think this will work for me. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 12:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31050#M7387</guid>
      <dc:creator>TedShelly</dc:creator>
      <dc:date>2011-10-19T12:08:18Z</dc:date>
    </item>
    <item>
      <title>%include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31051#M7388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also do it with the old-style macros.&amp;nbsp; E.g.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;macro xinc&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where sex eq "M";&lt;/P&gt;&lt;P&gt;%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xinc&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 12:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31051#M7388</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-19T12:28:22Z</dc:date>
    </item>
    <item>
      <title>%include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31052#M7389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know there is no particular limitation on using %INCLUDE in PROC SQL. The rule is that %INCLUDE has to appear at a statement boundary. Of course there are not a lot of statement boundaries in SQL code.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;TedShelly wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’d like to be able to include blocs of code within PROC SQL using %include statements.&amp;nbsp; But doing so generates error messages.&amp;nbsp; Is there some option or technique to accomplish this?&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 12:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31052#M7389</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-10-19T12:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: %include in PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31053#M7390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ... correct (as expected !) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;file 'z:\stuff.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;put 'create table males as select *' /&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;'from sashelp.class' /&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;'where sex eq "M";';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%include 'z:\stuff.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;26&amp;nbsp;&amp;nbsp; proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;27&amp;nbsp;&amp;nbsp; %include 'z:\stuff.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Table WORK.MALES created, with 10 rows and 5 columns.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;31&amp;nbsp;&amp;nbsp; quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.96 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.14 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 14:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/include-in-PROC-SQL/m-p/31053#M7390</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-10-19T14:43:46Z</dc:date>
    </item>
  </channel>
</rss>

