<?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 Close dataset in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890214#M372854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;   what will happen if you did n't write CLOSE DATASET at the end of the file transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jan 2007 11:37:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-08T11:37:29Z</dc:date>
    <item>
      <title>Close dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890214#M372854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;   what will happen if you did n't write CLOSE DATASET at the end of the file transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890214#M372854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Close dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890215#M372855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CLOSE DATASET dset. &lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement closes the file specified in dset. dset must be character-type data object that contains the platform-specific name of the file. If the file is already closed or does not exist, the statement is ignored and the return value sy-subrc is set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the operating system buffers data before it is written to a file and there is still data in the buffer, this data is written to the file before closing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;An opened file that was not explicitly closed using CLOSE DATASET is automatically closed when the program is exited. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a file was opened without the FILTER addition, sy-subrc always contains the value 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a file was opened using the FILTER addition, sy-subrc contains the return value of the filter program, which is returned by the operating system. This value is generally 0 if the statement was executed successfully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890215#M372855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Close dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890216#M372856</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;&amp;lt;u&amp;gt;CLOSE FILE:&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program will close all sequential files, which are open at the end of the program. &lt;/P&gt;&lt;P&gt;However, it is a good programming practice to explicitly close all the datasets that were opened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLOSE DATASET &amp;lt;file name&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC will be set to 0 or 8 depending on whether the CLOSE is successful or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:41:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890216#M372856</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2007-01-08T11:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Close dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890217#M372857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the dataset is not closed...and when u run once again the program it gives error. it tries to open the dataset but as already it is open it gives error.&lt;/P&gt;&lt;P&gt;so it is good practice to always use close dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:45:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890217#M372857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Close dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890218#M372858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi srikanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET &amp;lt;dsn&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement closes the file &amp;lt;dsn&amp;gt;. The naming convention is described in the section Opening a File.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;You only need to close a file if you want to delete its contents the next time you open it for write access. &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;However, to avoid errors, and to make your programs easier to read, you should always close a file before the next OPEN DATASET statement. The CLOSE statement divides your program into logical blocks, and makes them easier to maintain.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA FNAME(60) VALUE 'myfile'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;  .....&lt;/P&gt;&lt;P&gt;CLOSE FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR INPUT.&lt;/P&gt;&lt;P&gt;  .....&lt;/P&gt;&lt;P&gt;CLOSE FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR INPUT AT POSITION &amp;lt;pos&amp;gt;.&lt;/P&gt;&lt;P&gt;  .....&lt;/P&gt;&lt;P&gt;CLOSE FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The CLOSE statement is not obligatory in this example,&amp;lt;/b&amp;gt; but it does improve the layout of the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890218#M372858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Close dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890219#M372859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what will happen if I am using same OPEN DATASET statement with out closing the previous file. will it survives or it will through an error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2007 11:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/close-dataset/m-p/1890219#M372859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-08T11:57:28Z</dc:date>
    </item>
  </channel>
</rss>

