<?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: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171616#M264327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that once done, the above is final and the dataset you already had will be irrevocably changed!.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The warninig comes about due to you writing a table in your create table statement which is of the same name as the you are selecting the data from, hence overwriting the read in table.&amp;nbsp; This is fine if that is indeed what you intended to do.&amp;nbsp; See: &lt;A href="http://support.sas.com/kb/12/062.html" title="http://support.sas.com/kb/12/062.html"&gt;12062 - "Warning: CREATE TABLE statement recursively references the target table"&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can use the&lt;/P&gt;&lt;P&gt;proc sql&amp;nbsp; undo_policy=none;&lt;/P&gt;&lt;P&gt;to get rid of this.&lt;/P&gt;&lt;P&gt;I would again point out that you need to be clear on what you are doing and in general the process would be to create a new table or view based of existing data.&amp;nbsp; There are other options to this, for instance you can update existing tables.&amp;nbsp; So if you want to change tmp do:&lt;BR /&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update tmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set calc_var=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; something is true;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Oct 2014 14:04:49 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-10-03T14:04:49Z</dc:date>
    <item>
      <title>WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171614#M264325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should I worry about this warning?&lt;/P&gt;&lt;P&gt;I realize it appears to be bad-practice, but&lt;/P&gt;&lt;P&gt;Should I worry?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;MPRINT(CUSTOMER):&amp;nbsp;&amp;nbsp; proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CUSTOMER):&amp;nbsp;&amp;nbsp; create table tmp as select * from tmp;&lt;/P&gt;&lt;P&gt;WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; problem.&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.TMP created, with 124698 rows and 1 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&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.54 seconds&lt;/P&gt;&lt;P&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.66 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 13:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171614#M264325</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2014-10-03T13:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171615#M264326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. You should worry . It seems you need change some tables name .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 13:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171615#M264326</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-03T13:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171616#M264327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that once done, the above is final and the dataset you already had will be irrevocably changed!.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The warninig comes about due to you writing a table in your create table statement which is of the same name as the you are selecting the data from, hence overwriting the read in table.&amp;nbsp; This is fine if that is indeed what you intended to do.&amp;nbsp; See: &lt;A href="http://support.sas.com/kb/12/062.html" title="http://support.sas.com/kb/12/062.html"&gt;12062 - "Warning: CREATE TABLE statement recursively references the target table"&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can use the&lt;/P&gt;&lt;P&gt;proc sql&amp;nbsp; undo_policy=none;&lt;/P&gt;&lt;P&gt;to get rid of this.&lt;/P&gt;&lt;P&gt;I would again point out that you need to be clear on what you are doing and in general the process would be to create a new table or view based of existing data.&amp;nbsp; There are other options to this, for instance you can update existing tables.&amp;nbsp; So if you want to change tmp do:&lt;BR /&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update tmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set calc_var=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; something is true;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 14:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171616#M264327</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-10-03T14:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171617#M264328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So we all benefit... Maybe I am just lucky.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just got an answer from our 20 year SAS veteran here.&lt;/P&gt;&lt;P&gt;He says, "&lt;SPAN style="font-size: 10pt; line-height: 1.5em; color: #1f497d;"&gt;Never known to cause actual problems&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 15:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171617#M264328</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2014-10-03T15:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171618#M264329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just don't use&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;&amp;nbsp; create table temp as select onevar from temp;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Unless that table only had one variable, you just lost all but the one variable. Of course the warning comes too late...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For similar concerns I dislike use of:&lt;/P&gt;&lt;P&gt;Data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set temp;&lt;/P&gt;&lt;P&gt;structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I inherited some code like this and found a section that was recoding a variable with values of 1 and 2 to 1, 3 to 2, 4 to 3. The previous user had run the same code a couple times and ended up with almost all values of 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 15:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171618#M264329</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-03T15:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171619#M264330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my 20 year vet DID just now tell me "get rid of warnings".&lt;/P&gt;&lt;P&gt;Soo, when he said its not a problem, its because he gets rid of all warnings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Do what the teacher says"..... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 15:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171619#M264330</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2014-10-03T15:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171620#M264331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trust me, once you have accidentally removed 6 years of edit check output in Oracle and spend quite a long time trying to rebuild it you won't be so blase about warnings/errors :smileyshocked:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 15:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-This-CREATE-TABLE-statement-recursively-references-the/m-p/171620#M264331</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-10-03T15:58:05Z</dc:date>
    </item>
  </channel>
</rss>

