<?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 DATAn naming scheme and rollover in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727239#M226140</link>
    <description>&lt;P&gt;I use the _DATA_ trick a lot, especially for temporary datasets that I create inside macros and then delete when the macro has been executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have found a problem with that though: it seems to me that the number 'n' in the DATAn naming scheme rolls over at some point, and n starts over from 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This causes a lot of problems, and my programs stop working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see in the documentation when the rollover is, does anybody know:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What the maximum allowed number for DATAn is&lt;/LI&gt;
&lt;LI&gt;If it is possible to extend it&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 20:35:17 GMT</pubDate>
    <dc:creator>gabonzo</dc:creator>
    <dc:date>2021-03-17T20:35:17Z</dc:date>
    <item>
      <title>DATAn naming scheme and rollover</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727239#M226140</link>
      <description>&lt;P&gt;I use the _DATA_ trick a lot, especially for temporary datasets that I create inside macros and then delete when the macro has been executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have found a problem with that though: it seems to me that the number 'n' in the DATAn naming scheme rolls over at some point, and n starts over from 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This causes a lot of problems, and my programs stop working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see in the documentation when the rollover is, does anybody know:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What the maximum allowed number for DATAn is&lt;/LI&gt;
&lt;LI&gt;If it is possible to extend it&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 20:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727239#M226140</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-03-17T20:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: DATAn naming scheme and rollover</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727243#M226143</link>
      <description>&lt;P&gt;I don't have an answer for your exact question, but I do have some advice from my experience. When I'm creating a series of temp/scratch data sets that I'm going to turn around and delete at the end of a process, I like to isolate them to their own folder (outside of WORK library). That gives me more options for deleting the whole shebang without worrying about conflicts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I documented this in &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-delete-SAS-data-sets/ta-p/720671" target="_self"&gt;How to delete SAS data sets&lt;/A&gt;.&amp;nbsp; Specifically the trick I use is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;/* create a subfolder in WORK for my data */
options dlcreatedir;
libname scratch "%sysfunc(getoption(WORK))/scratch";

/* just adding some data for example purpose */
data scratch.a1 scratch.a2 scratch.a3;
 set sashelp.class;
run;

/* more operations with scratch data */

/* now clear it when ready */
proc datasets lib=scratch kill nolist;
quit;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 20:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727243#M226143</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-03-17T20:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: DATAn naming scheme and rollover</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727247#M226145</link>
      <description>I like your idea, but it would be tricky to use it to solve my problem.&lt;BR /&gt;&lt;BR /&gt;I don't create that many datasets per macro (perhaps three at most), but I have many macros, and in the current task I am doing a statistic simulation where I have to run the same set of macros over and over again for tens of thousands of times.&lt;BR /&gt;&lt;BR /&gt;One way I could use your trick is to create a subfolder for each macro, but I am concerned the overhead will slow down an already slow program. Moreover, isn't PROC DATASETS supposed to be a bit of a resource hog?&lt;BR /&gt;&lt;BR /&gt;Thanks anyway</description>
      <pubDate>Wed, 17 Mar 2021 21:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727247#M226145</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-03-17T21:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: DATAn naming scheme and rollover</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727250#M226148</link>
      <description>&lt;P&gt;Not a solution but similar to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;I use a common prefix, typically _dataSetName for all my temp tables and then drop them at once at the end using PROC DATASETS and the shortcut colon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=work;
delete _: ;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is a reference that illustrates how to refer to variables and datasets in a short cut list:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255651"&gt;@gabonzo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I use the _DATA_ trick a lot, especially for temporary datasets that I create inside macros and then delete when the macro has been executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have found a problem with that though: it seems to me that the number 'n' in the DATAn naming scheme rolls over at some point, and n starts over from 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This causes a lot of problems, and my programs stop working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see in the documentation when the rollover is, does anybody know:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What the maximum allowed number for DATAn is&lt;/LI&gt;
&lt;LI&gt;If it is possible to extend it&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 21:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727250#M226148</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-17T21:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: DATAn naming scheme and rollover</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727252#M226150</link>
      <description>&lt;P&gt;Ok, it seems a consensus is forming. Perhaps I will go with this solution.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 21:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727252#M226150</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-03-17T21:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: DATAn naming scheme and rollover</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727255#M226153</link>
      <description>&lt;P&gt;If you don't like PROC DATASETS (it does have some overhead), then PROC DELETE is quick and light. You can delete a range, but not a "wildcard" list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc delete library=work data=DATA1-DATA5; run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 21:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATAn-naming-scheme-and-rollover/m-p/727255#M226153</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-03-17T21:22:55Z</dc:date>
    </item>
  </channel>
</rss>

