<?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: sql error in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179287#M34232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza. I will try the options tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I could not post the log. I did not have any access to any other website when I accessed into virtual server, as the data sets are very confidential. There is no output, as there is ERROR. In log, it shows that ERROR(&lt;STRONG style="color: #d24726; font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;The following columns were not found in the contributing tables: BE_ID.&lt;/STRONG&gt;) notice under the command &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;select count(distinct BE_ID) as Nbe_uni,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) as Nbe&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;from MBSF_AB&amp;amp;i.;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Feb 2015 02:48:59 GMT</pubDate>
    <dc:creator>michellel</dc:creator>
    <dc:date>2015-02-24T02:48:59Z</dc:date>
    <item>
      <title>sql error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179283#M34228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;Hi, I have a question as below. Thanks a lot in advance for your answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444; background: white;"&gt;I want to see the distinct count and total count.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;When I tried codes as blow for just one year 2010, it is fine to get result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;select count(distinct BE_ID) as Nbe_uni,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) as Nbe&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;from mbsf_ab2010;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;When I tried to use macro to get results for 10 years, it shows error for every year as blow, but there is variable BE_ID for every year and the files are located in work folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%macro uni;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%do i=2001 %to 2010;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;select count(distinct BE_ID) as Nbe_uni,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) as Nbe&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;from MBSF_AB&amp;amp;i.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;STRONG style="color: #d24726; font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;ERROR: The following columns were not found in the contributing tables: BE_ID.&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%uni;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 01:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179283#M34228</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-24T01:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: sql error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179284#M34229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the code seems correct. could you please check the file individually again&amp;nbsp; to make sure there is BE_ID variable in all the files. Alternative to confirm the same , please try to execute the code this way and see if it works without error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%macro uni;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;STRONG style="color: #444444; font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif';"&gt;%do i=2010 %to 2010;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt; &lt;/SPAN&gt; &lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;select count(distinct BE_ID) as Nbe_uni,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) as Nbe&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;from MBSF_AB&amp;amp;i.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;%uni;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal" style="background: none repeat scroll 0% 0% white;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Microsoft YaHei','sans-serif'; color: #444444;"&gt;Jag&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 02:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179284#M34229</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-02-24T02:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: sql error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179285#M34230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run the code with the following options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options mprint symbolgen;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*code;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the output, it should help you debug the code. If you still can't find the error, post the log with the following options from a single iteration with the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 02:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179285#M34230</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-24T02:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: sql error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179286#M34231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagadishkatam. I have checked the variable BE_ID for ten files. They are all there, with the same name. I did run the code as you listed, but still got that ERROR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 02:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179286#M34231</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-24T02:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: sql error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179287#M34232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza. I will try the options tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I could not post the log. I did not have any access to any other website when I accessed into virtual server, as the data sets are very confidential. There is no output, as there is ERROR. In log, it shows that ERROR(&lt;STRONG style="color: #d24726; font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;The following columns were not found in the contributing tables: BE_ID.&lt;/STRONG&gt;) notice under the command &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;select count(distinct BE_ID) as Nbe_uni,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) as Nbe&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;from MBSF_AB&amp;amp;i.;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 02:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179287#M34232</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-24T02:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: sql error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179288#M34233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;MBSF_AB&amp;amp;i.;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #575757;"&gt;to your macro loop and look at the output(s) of that.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 07:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sql-error-in-macro/m-p/179288#M34233</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-02-24T07:04:07Z</dc:date>
    </item>
  </channel>
</rss>

