<?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: Inserting data into a table that has more columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512496#M138053</link>
    <description>It has 200+ variables as many units use the table for various purposes. It is pushing the data to a SQL database. There might be a better way to do it which I am not aware as I am a beginner. Thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;.</description>
    <pubDate>Tue, 13 Nov 2018 10:00:21 GMT</pubDate>
    <dc:creator>Myurathan</dc:creator>
    <dc:date>2018-11-13T10:00:21Z</dc:date>
    <item>
      <title>Inserting data into a table that has more columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512487#M138050</link>
      <description>&lt;P&gt;Hi Helpers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 200 columns. I would push this table's data into a master table that has 250 columns. Column names are same. When I push the data I want&amp;nbsp;unavailable columns to get a NULL value. I am using following code to push my data to a table that has same columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc SQL;
  Insert Into one.tbl_one Select * From tble_two;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 09:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512487#M138050</guid>
      <dc:creator>Myurathan</dc:creator>
      <dc:date>2018-11-13T09:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table that has more columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512493#M138051</link>
      <description>&lt;P&gt;Some starter questions.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why have a dataset with 200+ variables, sounds like bad modelling in either SAS or Database.&lt;/P&gt;
&lt;P&gt;Why use SQL, unless your connecting to a database, it would be easier to set two datasets in datastep.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 09:56:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512493#M138051</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-13T09:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table that has more columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512496#M138053</link>
      <description>It has 200+ variables as many units use the table for various purposes. It is pushing the data to a SQL database. There might be a better way to do it which I am not aware as I am a beginner. Thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;.</description>
      <pubDate>Tue, 13 Nov 2018 10:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512496#M138053</guid>
      <dc:creator>Myurathan</dc:creator>
      <dc:date>2018-11-13T10:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table that has more columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512498#M138054</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case proc SQL insert will not work. You can use PROC APPEND procedure with FORCE options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc append base=tble_one data=tble_two force;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 10:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512498#M138054</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-11-13T10:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table that has more columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512506#M138056</link>
      <description>&lt;P&gt;Well, if you continue with the bad model, and continue to use SQL, then your only option is to put the variables you want to insert into the code:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  insert into one.tbl_one (var1,var2,var3...)
  select * From tble_two;
quit;&lt;/PRE&gt;
&lt;P&gt;SQL wasn't designed to be used with lots of variables, so its a chore to work with if you have a bad model.&amp;nbsp; Vice versa, SAS datastep is easier to work with more variables.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 10:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-data-into-a-table-that-has-more-columns/m-p/512506#M138056</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-13T10:59:31Z</dc:date>
    </item>
  </channel>
</rss>

