<?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: Proc Append then Delete in a loop in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41615#M10771</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi data_null_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why you use "if 0 then modify &amp;amp;base" instead of "modify &amp;amp;base"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very mych! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Nov 2011 15:49:29 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2011-11-04T15:49:29Z</dc:date>
    <item>
      <title>Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41602#M10758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have files named D0912, D0913, D0914,,,D9999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to do the code below for a given start file and end file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append force&lt;/P&gt;&lt;P&gt;base = D0912&lt;/P&gt;&lt;P&gt;data = D0913;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc delete data = D0913;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append force&lt;/P&gt;&lt;P&gt;base = D0912&lt;/P&gt;&lt;P&gt;data = D0914;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc delete data = D0914;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append force&lt;/P&gt;&lt;P&gt;base = D0912&lt;/P&gt;&lt;P&gt;data = D0915;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc delete data = D0915;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So on and so forth...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to just say start at D0912 and do that over and over until D9999.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2011 20:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41602#M10758</guid>
      <dc:creator>1800bigk</dc:creator>
      <dc:date>2011-11-03T20:38:08Z</dc:date>
    </item>
    <item>
      <title>Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41603#M10759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following does what you asked for, but I post my response with A BIG WARNING.&lt;/P&gt;&lt;P&gt;First, make a copy of your starting dataset.&amp;nbsp; What you said you wanted to do overwrites the first dataset.&amp;nbsp; That is rather risky and I definitely wouldn't do it without backing up the data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, since you are deleting all of the other datasets as well, I would back them up before attempting to run the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*create some test data*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data d0999;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain x (1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data d1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain x (2);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data d1001;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain x (3);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/*end of test data creation*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %macro doit(first,last);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do i=&amp;amp;first %to &amp;amp;last;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if "&amp;amp;i" eq "&amp;amp;first" %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('base',put(&amp;amp;first,z4.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('data',put(&amp;amp;i,z4.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if "&amp;amp;i" ne "&amp;amp;first" %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc append force&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base = D&amp;amp;base.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = D&amp;amp;data.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc delete data = D&amp;amp;data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend doit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%doit (999,1001)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2011 21:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41603#M10759</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-03T21:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41604#M10760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need any macros or loops.&amp;nbsp; Well the data step loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; D0912 D0913 D0914 D0915;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; base=D0912;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; append=D0913-D0915;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &amp;amp;base;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &amp;amp;base;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &amp;amp;append open=defer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;datasets&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &amp;amp;append;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I forgot about OPEN=DEFER which should improve performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: data _null_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2011 22:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41604#M10760</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-11-03T22:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41605#M10761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nice!&amp;nbsp; Did I say something, earlier today, about how difficult it is to see the best simplification?&amp;nbsp; I, for one, would definitely mark your response as being the correct one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2011 22:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41605#M10761</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-03T22:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41606#M10762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am getting an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;374 %let base=D0912;&lt;/P&gt;&lt;P&gt;375 %let append=D0913-D0915;&lt;/P&gt;&lt;P&gt;376 data &amp;amp;base;&lt;/P&gt;&lt;P&gt;377 if 0 then modify &amp;amp;base;&lt;/P&gt;&lt;P&gt;378 set &amp;amp;append open=defer;&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "APPEND".&lt;/P&gt;&lt;P&gt;1 D0913-D0915&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;-----&lt;/P&gt;&lt;P&gt;202&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, ;, END,&lt;/P&gt;&lt;P&gt;KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 12:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41606#M10762</guid>
      <dc:creator>1800bigk</dc:creator>
      <dc:date>2011-11-04T12:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41607#M10763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You appear to have pasted a stray character (1) in your code.&amp;nbsp; I copied, pasted and ran the code with no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 12:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41607#M10763</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-04T12:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41608#M10764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The dash between D0913 and D0915 is giving me the problem.&amp;nbsp; The 22 in the error message should be under the dash not the 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;P&gt;NOTE: Line generated by the macro variable "APPEND".&lt;/P&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;P&gt;1 D0913-D0915&amp;nbsp; ﻿&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;..............-&lt;/P&gt;&lt;P&gt;.............22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it's because I am on version 9.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 12:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41608#M10764</guid>
      <dc:creator>1800bigk</dc:creator>
      <dc:date>2011-11-04T12:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41609#M10765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that would definitely be why.&amp;nbsp; Thus, instead, try the macro method I proposed earlier in this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 13:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41609#M10765</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-04T13:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41610#M10766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how confident are we that this will scale to 9000+ data sets?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about a hash-based solution, so that all of the housekeeping occurs at run time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 13:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41610#M10766</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-11-04T13:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41611#M10767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case build a space delimited list.&amp;nbsp; You need at least SAS 9.2 to allow ranges of dataset names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select memname into :append separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.members &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname='WORK'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and memname like 'D%'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by memname&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 13:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41611#M10767</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-11-04T13:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41612#M10768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks, that worked perfect.&amp;nbsp; Ran quickly with ~ 200 hundred data sets so thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 13:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41612#M10768</guid>
      <dc:creator>1800bigk</dc:creator>
      <dc:date>2011-11-04T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41613#M10769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scale?&amp;nbsp; I'll leave that to others.&amp;nbsp; I do expect it would scale better than looping PROC APPENDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN=DEFER if it can be used should help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand what a hash would add.&amp;nbsp; Please enlighten me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 13:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41613#M10769</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-11-04T13:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41614#M10770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi art297,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your Macro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /*create some test data*/&lt;BR /&gt;data d0999;&lt;BR /&gt;&amp;nbsp; retain x (1);&lt;BR /&gt;run;&lt;BR /&gt;data d1000;&lt;BR /&gt;&amp;nbsp; retain x (2);&lt;BR /&gt;run;&lt;BR /&gt; &lt;BR /&gt;data d1001;&lt;BR /&gt;&amp;nbsp; retain x (3);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data d1002;&lt;BR /&gt;&amp;nbsp; retain x (4);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/************************/&lt;BR /&gt;%macro doit(second,last);&lt;BR /&gt;&amp;nbsp; %do i=&amp;amp;second %to &amp;amp;last;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('data',put(&amp;amp;i,z4.));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc append force&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base = d0999&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = D&amp;amp;data.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc delete data = D&amp;amp;data;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp; %end;&lt;BR /&gt;%mend doit;&lt;BR /&gt;%doit (1000,1002)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 14:45:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41614#M10770</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-11-04T14:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41615#M10771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi data_null_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why you use "if 0 then modify &amp;amp;base" instead of "modify &amp;amp;base"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very mych! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 15:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41615#M10771</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-11-04T15:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41616#M10772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because this is just APPEND.&amp;nbsp; We don't want to ready any data from BASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 16:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41616#M10772</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-11-04T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41617#M10773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since PROC APPEND is a statement in PROC DATASET I think you should at least nest the repeated APPENDs in PROC DATASETS.&amp;nbsp; If SAVE statement is not be appropiate you can just gen a DELETE for the list of APPEND data sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; D0912 D0913 D0914 D0915;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; base=D0912;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'APPEND BASE='&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"&amp;amp;base"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'DATA='&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,memname,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;';'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; :append&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; dictionary.members&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; libname eq &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'WORK'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; upcase(memname) ne &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%upcase&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"&amp;amp;base"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;datasets&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp; &amp;amp;append;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;save&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &amp;amp;base;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 16:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41617#M10773</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-11-04T16:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Append then Delete in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41618#M10774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Art's code is good enough except for typing some more words. It is very fast way for large tabls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep in mind that SAVE statement will only keep the &amp;amp;base , other tables will be deleted include other&amp;nbsp; needed tables, so you should be careful to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 06:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Append-then-Delete-in-a-loop/m-p/41618#M10774</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-11-07T06:50:36Z</dc:date>
    </item>
  </channel>
</rss>

