<?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: Clone a dataset ***including indexes*** in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211568#M39146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;What is lacking in PROC COPY INDEX=YES ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 14:53:17 GMT</pubDate>
    <dc:creator>JackHamilton</dc:creator>
    <dc:date>2015-07-28T14:53:17Z</dc:date>
    <item>
      <title>Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211566#M39144</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;Is this the best approach to clone a dataset &lt;SPAN style="text-decoration: underline; color: #ff0000;"&gt;&lt;STRONG&gt;including indexes&lt;/STRONG&gt;&lt;/SPAN&gt;?&amp;nbsp; The end result should be an empty dataset with all indexes in place from the source dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;options&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; obs=max;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; zipcode;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; sashelp.zipcode;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000c0; background: white;"&gt;datasets&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;lib&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=work &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;nowarn&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;nolist&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;index&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;index&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; sex;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;index&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; age;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;index&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; primary=(height weight);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; zipcode;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;index&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; statecode;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;index&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; statename;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; temp spde &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;"%sysfunc(pathname(work))"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; temp=yes;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;options&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; obs=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000c0; background: white;"&gt;copy&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=work &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=temp &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;clone&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; class zipcode;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;options&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; obs=max;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000c0; background: white;"&gt;datasets&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;lib&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=temp &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;nowarn&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;nolist&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;change&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; class=class2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;change&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; zipcode=zipcode2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000c0; background: white;"&gt;copy&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=temp &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=work;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; class2 zipcode2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: fuchsia; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I like the fact that the SPDE engine allows me to create a temporary library whose directory will be deleted by SAS when the library is freed.&amp;nbsp; Which is why I'm using that approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing to note is, on my system (Windows), the cloned dataset is "large", even though it's empty.&amp;nbsp; This is due to the Data Set Page Size being different due to the two different engines being used.&amp;nbsp; I read the doc on proc copy; to me it seemed that the clone option would create a dataset with the same internal structure as the source dataset (even across the two engines).&amp;nbsp; My "real" code is SPDE to SPDE, so this won't be an issue.&amp;nbsp; My real code also needs to clone two datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if only SAS supported:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table work.class2 like sashelp.class including indexes;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or something like that.&amp;nbsp; If the above code IS the current best approach, perhaps SAS could make this a bit easier in a future release?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 07:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211566#M39144</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2015-07-27T07:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211567#M39145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My standard way of doing this is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc append base=want data=have (obs=0);&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will preserve all metadata from the template table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 06:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211567#M39145</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-07-28T06:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211568#M39146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;What is lacking in PROC COPY INDEX=YES ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 14:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211568#M39146</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2015-07-28T14:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211569#M39147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Linus, that helped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps it's better to see the code in context, so the full picture is evident.&amp;nbsp; FWIW this approach is based on work from the programmer before me, although I've modified it a bit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*** Load the data *** ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* The desired output is to: ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 1) A backup of yesterdays data named "_old" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 2) Load todays data with the correct output name ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* And to do so with optimal performance and recoverability ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* The "flow" is: ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 1) Create an empty skeleton dataset (including indexes) based on the current "fact" dataset ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 2) Delete the "_old" dataset (day before yesterdays data) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 3) Rename the current "fact" dataset to "_old" (now it is yesterdays data) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 4) Load todays data into the "_tmp" dataset ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp; 5) Rename the "_tmp" dataset to the current "fact" dataset ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* We could reverse #3 and #4 (rename then load directly) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* but that is more confusing if an error occurs during the load ;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* and we have to manually recover ;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; load_data(type,lib,target);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; type=%lowcase(&amp;amp;type);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;type eq hospital) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; source=workspde.claimfact&amp;amp;type._epi_xfr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;type eq medical)&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; source=workspde.claimfact&amp;amp;type._epi;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 11pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; %&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-size: 11pt; font-family: 'Courier New'; color: green; background: white;"&gt;* save current syscc value and reset to 0 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; syscc_temp=&amp;amp;syscc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; syscc=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; proc datasets lib=&amp;amp;lib nolist nowarn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;syscc eq &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Create skeleton dataset including indexes for later use ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete &amp;amp;target._tmp;&amp;nbsp; %&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* In case it exists ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; append base=&amp;amp;target._tmp data=&amp;amp;target (obs=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;syscc eq &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Delete the "_old" dataset (now the day before yesterdays data) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete &amp;amp;target._old;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;syscc eq &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Rename the current "fact" dataset to "_old" (now yesterdays data) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; change &amp;amp;target=&amp;amp;target._old;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;syscc eq &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Load todays data into the "_tmp" dataset ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; append base=&amp;amp;target._tmp data=&amp;amp;source;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&amp;amp;syscc eq &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Rename the "_tmp" dataset to the current "fact" dataset (now todays data) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; change &amp;amp;target._tmp=&amp;amp;target;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; syscc=&amp;amp;syscc_temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 11pt; line-height: 1.5em; background-color: white;"&gt;&amp;nbsp; %&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 11pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;&lt;EM&gt;bench&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 11pt; line-height: 1.5em; background-color: white;"&gt;(elapsed,data=elapsed,message=Load: Load &amp;amp;type data)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 07:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211569#M39147</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2015-07-29T07:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211570#M39148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jack.&amp;nbsp; The target cloned dataset needs to have a different name in the same library as the source dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 07:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211570#M39148</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2015-07-29T07:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211571#M39149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There have been several occasions over the years when I have wanted a built-in utility that would copy and rename at the same time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, you could just copy the original to the temporary library, rename it there, and then copy it back to the original library.&amp;nbsp; But the APPEND solution seems easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to find the documentation that says APPEND will create indexes for a non-existent BASE when DATA has indexes.&amp;nbsp; Couldn't find it.&amp;nbsp; It does says that constraints will be copied, but a non-unique index is not a constraint.&amp;nbsp; Is this just folk wisdom passed down from programmers of yore?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 16:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211571#M39149</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2015-07-29T16:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Clone a dataset ***including indexes***</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211572#M39150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One last comment, perhaps as much to myself as anyone...but if you want to chime in please do so &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hmmm...in thinking about this further, I wonder if generation data sets would work well here?&amp;nbsp; It's been a billion years since I've used them.&amp;nbsp; Time to revisit the doc!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; I do wish proc append would roll over the generation group.&amp;nbsp; If we have a 10M row base table and are appending 1K rows from today's transactions, I don't want to run a full data step just to roll over the generation group.&amp;nbsp; If there IS a way to roll over the generation group using proc append, let me know.&amp;nbsp; Otherwise, the "manual" approach to creating a backup from the above post may be the way to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;datasets&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;lib&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=work &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;nowarn&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;nolist&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;kill&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* only need to specify the genmax option the first time ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; class (genmax=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;3&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"First"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* another data step ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; class (&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"Second"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* proc append (bummer...no work.Class#002) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;append&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;base&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=class (label=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"Third"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* one more iteration, the first one will be deleted ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; class (&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"Fourth"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Added edit about proc append and generation groups&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 01:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Clone-a-dataset-including-indexes/m-p/211572#M39150</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2015-07-31T01:58:42Z</dc:date>
    </item>
  </channel>
</rss>

