<?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: Appending in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803984#M33382</link>
    <description>.</description>
    <pubDate>Sat, 26 Mar 2022 01:44:31 GMT</pubDate>
    <dc:creator>Vasundha</dc:creator>
    <dc:date>2022-03-26T01:44:31Z</dc:date>
    <item>
      <title>Adding</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803964#M33378</link>
      <description>.</description>
      <pubDate>Sat, 26 Mar 2022 01:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803964#M33378</guid>
      <dc:creator>Vasundha</dc:creator>
      <dc:date>2022-03-26T01:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803983#M33381</link>
      <description>&lt;P&gt;Using DMY dates in filenames makes this unnecessarily hard, so I recommend to change this to dates in YMD order as a first step. This will make working with your datasets in the future much easier.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 06:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803983#M33381</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T06:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803984#M33382</link>
      <description>.</description>
      <pubDate>Sat, 26 Mar 2022 01:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803984#M33382</guid>
      <dc:creator>Vasundha</dc:creator>
      <dc:date>2022-03-26T01:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803988#M33383</link>
      <description>&lt;P&gt;With a sensible date, it's easy by using wildcards:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all;
set xyz_2022:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 06:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803988#M33383</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T06:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803990#M33384</link>
      <description>.</description>
      <pubDate>Sat, 26 Mar 2022 01:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803990#M33384</guid>
      <dc:creator>Vasundha</dc:creator>
      <dc:date>2022-03-26T01:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803992#M33385</link>
      <description>&lt;P&gt;The SET statement which I posted will add all currently present datasets that begin with XYZ_2022.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 07:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803992#M33385</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T07:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803994#M33386</link>
      <description>.</description>
      <pubDate>Sat, 26 Mar 2022 01:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803994#M33386</guid>
      <dc:creator>Vasundha</dc:creator>
      <dc:date>2022-03-26T01:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803996#M33387</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/420851"&gt;@Vasundha&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&amp;nbsp;can't be renamed them.&lt;/BLOCKQUOTE&gt;
&lt;P class="1648193114887"&gt;Bullshit (sorry, but...). You can always improve your data designs, and renaming NOW is little work compared to the hassles you will always have in the future with such STUPID file/dataset names.&lt;/P&gt;
&lt;P class="1648193114887"&gt;If I had tolerated such sub-optimals in my professional life, my time would have been swamped by unnecessary and tedious extra work, keeping me from doing useful things, or finishing them in time (or simply having a beer for celebrating good work done). Correct your design issue NOW, continuing the current state will only cause more work when you finally cannot go on any further with the current situation.&lt;/P&gt;
&lt;P class="1648193114887"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="1648193114887"&gt;Changing the names once isn't so hard at all:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lib=library; /* set your library name here */

data _null_;
call execute("proc datasets lib=&amp;amp;lib.;change");
do date = '01jan2022' to today(); /* you can start here with the earliest date overall */
  olddate = put(date,date9.);
  newdate = put(date,yymmddn8.);
  call execute (" xyz_" !! olddate !! "=xyz_" !! newdate);
end;
call execute(";quit;");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="1648193114887"&gt;You can use a similar approach to do the appending, but I &lt;STRONG&gt;STRONGLY, STRONGLY, STRONGLY&lt;/STRONG&gt; recommend against keeping the current name structure.&lt;/P&gt;
&lt;P class="1648193114887"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="1648193114887"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 07:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/803996#M33387</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T07:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804000#M33388</link>
      <description>.</description>
      <pubDate>Sat, 26 Mar 2022 01:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804000#M33388</guid>
      <dc:creator>Vasundha</dc:creator>
      <dc:date>2022-03-26T01:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804002#M33389</link>
      <description>&lt;P&gt;Please post the complete log of the DATA _NULL_ and the subsequently generated PROC DATASETS.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 08:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804002#M33389</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T08:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804005#M33390</link>
      <description>&lt;P&gt;Everything that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;says. But should you be lucky enough that the Xyz_... "root" name of your tables will only match the tables you want to concatenate then you might get away with below code.&lt;/P&gt;
&lt;P&gt;Please note: This will just be a "make it work" but not a clean solution.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create sample data */
options dlcreatedir;
libname have "%sysfunc(pathname(work))\have";
data have.Xyz_25MAR2022 have.Xyz_26MAR2022;
  set sashelp.class;
run;

/* create Want table with all daily tables concatenated */
data want;
  set have.Xyz_:;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 09:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804005#M33390</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-03-25T09:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804015#M33392</link>
      <description>.</description>
      <pubDate>Sat, 26 Mar 2022 01:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804015#M33392</guid>
      <dc:creator>Vasundha</dc:creator>
      <dc:date>2022-03-26T01:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Appending</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804024#M33393</link>
      <description>&lt;P&gt;This is a macro solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyz_01jan2022;
set sashelp.class;
run;

data xyz_02jan2022;
set sashelp.class;
run;

%let lib=WORK; /* set your library name here */

%macro combine;
data want;
set
%do date = %sysevalf('01jan2022'd) %to %sysfunc(today());
  %let dt = %sysfunc(putn(&amp;amp;date.,date9.));
  %if %sysfunc(exist(&amp;amp;lib..xyz_&amp;amp;dt.))
  %then %do;
  &amp;amp;lib..xyz_&amp;amp;dt.
  %end;
%end;
;
run;
%mend;
%combine
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now compare that to the simplicity of using a wildcard (and add in the fact that YMD dates will always sort properly, so selecting files that are old enough for deleting/archiving or "new" enough for processing is done in a single comparison), and you see how bad the current design is.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 10:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Adding/m-p/804024#M33393</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-25T10:12:42Z</dc:date>
    </item>
  </channel>
</rss>

