<?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 Same dataset referenced in output and input in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53672#M14835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks DJ / Art.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Aug 2011 07:12:18 GMT</pubDate>
    <dc:creator>Arumugam</dc:creator>
    <dc:date>2011-08-25T07:12:18Z</dc:date>
    <item>
      <title>Same dataset referenced in output and input</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53668#M14831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to SAS.I saw same dataset is referenced for both input and output.I want to understand what happens in the background.How sas handles the same sas dataset as input and output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; data&amp;nbsp; temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2011 10:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53668#M14831</guid>
      <dc:creator>Arumugam</dc:creator>
      <dc:date>2011-08-24T10:36:16Z</dc:date>
    </item>
    <item>
      <title>Same dataset referenced in output and input</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53669#M14832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically, it starts off by reading in from the original dataset, but outputting to a temporary file.&amp;nbsp; In your example this would be called "code.lck" and should appear in the same folder as the rest of your datasets (e.g. your WORK library).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the process is finished, assuming there were no errors, SAS deletes the original file (code.sas7bdat) and renames the temporary file to replace the original.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same process happens when creating a new dataset for the first time, or overwriting an old one.&amp;nbsp; E.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one;&lt;/P&gt;&lt;P&gt;set two;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "one.lck" file is created first, and if it already exists "one.sas7bdat" is deleted once the code finishes running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're running code that takes long enough, you can see these files being created/deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2011 13:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53669#M14832</guid>
      <dc:creator>DF</dc:creator>
      <dc:date>2011-08-24T13:11:26Z</dc:date>
    </item>
    <item>
      <title>Same dataset referenced in output and input</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53670#M14833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;However, the behavior that DF describes can be controlled.&amp;nbsp; Take a look at: &lt;A href="http://support.sas.com/techsup/technote/ts250.html"&gt;http://support.sas.com/techsup/technote/ts250.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2011 13:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53670#M14833</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-24T13:12:44Z</dc:date>
    </item>
    <item>
      <title>Same dataset referenced in output and input</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53671#M14834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah - thanks Art!&amp;nbsp; I always forget about Modify and Update...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2011 13:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53671#M14834</guid>
      <dc:creator>DF</dc:creator>
      <dc:date>2011-08-24T13:14:31Z</dc:date>
    </item>
    <item>
      <title>Same dataset referenced in output and input</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53672#M14835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks DJ / Art.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 07:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Same-dataset-referenced-in-output-and-input/m-p/53672#M14835</guid>
      <dc:creator>Arumugam</dc:creator>
      <dc:date>2011-08-25T07:12:18Z</dc:date>
    </item>
  </channel>
</rss>

