<?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: Insert into table, then sort the data without changing destination table name? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340058#M63207</link>
    <description>&lt;P&gt;Is there something wrong with using Proc Append and then Proc Sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc append base=perm_table data=source;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=perm_table;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by id;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2017 18:53:12 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-03-10T18:53:12Z</dc:date>
    <item>
      <title>Insert into table, then sort the data without changing destination table name?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340054#M63205</link>
      <description>&lt;P&gt;I have a process that inserts data into a permanent table, after the insert, the permanent table has to be sorted. The&amp;nbsp;should run about once a month.&lt;/P&gt;&lt;P&gt;I wrote a create table statement where the source and destination are the same permanent table and get the following error: "This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;googled it and found there's an option to disable the warning, but I'm wondering if it's bad practice to leave it like this, and&amp;nbsp;if so, how do I write the program so as to not risk data integirty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
insert into perm_table
select * from source;

create table perm_table as
select * from perm_table
order by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Mar 2017 18:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340054#M63205</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-03-10T18:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into table, then sort the data without changing destination table name?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340058#M63207</link>
      <description>&lt;P&gt;Is there something wrong with using Proc Append and then Proc Sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc append base=perm_table data=source;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=perm_table;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by id;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 18:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340058#M63207</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-10T18:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into table, then sort the data without changing destination table name?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340068#M63208</link>
      <description>&lt;P&gt;No, I forget to use other procs sometimes because I'm more familiarized with sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-into-table-then-sort-the-data-without-changing/m-p/340068#M63208</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-03-10T19:15:09Z</dc:date>
    </item>
  </channel>
</rss>

