<?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 usin the loop in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91194#M573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a SAS program that uses the micro and at the end is generating the following tables that I want to export it to SQL:&lt;/P&gt;&lt;P&gt;NCxC1993&lt;/P&gt;&lt;P&gt;NCxC1994&lt;/P&gt;&lt;P&gt;NCxC1995&lt;/P&gt;&lt;P&gt;NCxC1996&lt;/P&gt;&lt;P&gt;NCxC1997&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use the following commands to create a table in SQL but I would like to use a loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*proc sql; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1993 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1993;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1994 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1994;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1995 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1995;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1996 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1996;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1997 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1997;&amp;nbsp; &lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;P&gt;run;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following loop but for some reason without any error does not create the tables in SQL (but the above command does)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro sqlloop(start=,end=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do year = &amp;amp;start %to &amp;amp;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_&amp;amp;year as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC&amp;amp;year;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sqlloop(start=1994,end=1995)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*-----------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any thoughts on why the sqlloop does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Oct 2012 16:59:40 GMT</pubDate>
    <dc:creator>goliPSU</dc:creator>
    <dc:date>2012-10-10T16:59:40Z</dc:date>
    <item>
      <title>usin the loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91194#M573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a SAS program that uses the micro and at the end is generating the following tables that I want to export it to SQL:&lt;/P&gt;&lt;P&gt;NCxC1993&lt;/P&gt;&lt;P&gt;NCxC1994&lt;/P&gt;&lt;P&gt;NCxC1995&lt;/P&gt;&lt;P&gt;NCxC1996&lt;/P&gt;&lt;P&gt;NCxC1997&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use the following commands to create a table in SQL but I would like to use a loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*proc sql; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1993 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1993;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1994 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1994;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1995 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1995;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1996 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1996;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_1997 as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC1997;&amp;nbsp; &lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;P&gt;run;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following loop but for some reason without any error does not create the tables in SQL (but the above command does)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro sqlloop(start=,end=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do year = &amp;amp;start %to &amp;amp;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table sqldb.cxcuse_dense_&amp;amp;year as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from NCxC&amp;amp;year;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sqlloop(start=1994,end=1995)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*-----------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any thoughts on why the sqlloop does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 16:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91194#M573</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-10-10T16:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: usin the loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91195#M574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you probably intended to post this in the macro/sql group: &lt;A _jive_internal="true" href="https://communities.sas.com/community/support-communities/sas_macro_facility_data_step_and_sas_language_elements"&gt;https://communities.sas.com/community/support-communities/sas_macro_facility_data_step_and_sas_language_elements&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 17:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91195#M574</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-10-10T17:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: usin the loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91196#M575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 17:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/usin-the-loop/m-p/91196#M575</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-10-10T17:36:16Z</dc:date>
    </item>
  </channel>
</rss>

