<?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 Employers_1, employers_2 etc... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453070#M114424</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a library called &lt;STRONG&gt;abcd &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;in this library there are few data sets and one of&amp;nbsp;the data set called Employers &amp;nbsp;is&amp;nbsp;creating with&lt;STRONG&gt; d&lt;/STRONG&gt;ynamic number at the end of the data set every time like&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;Employers_1, employers_2 ,employers_12, employers_22 etc..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution i need: &lt;/STRONG&gt;I&amp;nbsp;Need a piece of code&amp;nbsp;to read a latest data set which is creating with the dynamic number at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks in advance.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Apr 2018 05:28:52 GMT</pubDate>
    <dc:creator>Pandu</dc:creator>
    <dc:date>2018-04-11T05:28:52Z</dc:date>
    <item>
      <title>Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453070#M114424</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a library called &lt;STRONG&gt;abcd &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;in this library there are few data sets and one of&amp;nbsp;the data set called Employers &amp;nbsp;is&amp;nbsp;creating with&lt;STRONG&gt; d&lt;/STRONG&gt;ynamic number at the end of the data set every time like&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;Employers_1, employers_2 ,employers_12, employers_22 etc..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution i need: &lt;/STRONG&gt;I&amp;nbsp;Need a piece of code&amp;nbsp;to read a latest data set which is creating with the dynamic number at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks in advance.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 05:28:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453070#M114424</guid>
      <dc:creator>Pandu</dc:creator>
      <dc:date>2018-04-11T05:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453078#M114427</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select MemName 
      into :LatestEmpDataset trimmed
      from sashelp.vtable
         where MemName like 'EMPLOYERS%'
            having modate = max(modate)
   ;
quit;

%put &amp;amp;=LatestEmpDataset.;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2018 06:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453078#M114427</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-04-11T06:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453084#M114431</link>
      <description>&lt;P&gt;You can scan sashelp.vmembers to select tables where &lt;STRONG&gt;LIBNAME&lt;/STRONG&gt;=&amp;lt;your library&amp;gt; and scan(&lt;STRONG&gt;MEMNAME&lt;/STRONG&gt;,1,'_')&amp;nbsp; = upcase('employers').&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then sort the list and select the required one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For eample:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.vmembers(where=(
                   libname = "MY_LIB" and 
                   scan(memname,1,'_') = 'EMLOYERS'))
             out=emp_list(keep=memname);
        by libname memname;
run;

data _null_;
 set emp_list;
    by memname;
        if last.memname then
           call symput(last_emp,trim(memname));
run;
%put Last dataset is &amp;amp;lat_emp; 
        &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;finally see the log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Addapt it to your needs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 06:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453084#M114431</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-11T06:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453101#M114442</link>
      <description>&lt;P&gt;Question 1, why do you have multiple datasets containing the same data?&amp;nbsp; This is not good data modelling, keep all like data in one dataset, you can add a variable for the increment.&amp;nbsp; This minimises storage, I/O, and programming time.&amp;nbsp; For instance if you had:&lt;/P&gt;
&lt;P&gt;Employers:&lt;/P&gt;
&lt;P&gt;Iteration&amp;nbsp; &amp;nbsp;...&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You question would simply be a matter of where clausing the data out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Putting "data" in table names or column names will increase your program code and make for spaghetti code.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 08:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453101#M114442</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-11T08:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453109#M114448</link>
      <description>&lt;P&gt;But i don't have any&amp;nbsp;&lt;CODE class="  language-sas"&gt;vmembers exist in abcd library like Sashelp.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class="  language-sas"&gt;under&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;STRONG&gt;abcd&lt;/STRONG&gt;&amp;nbsp; library i have these are the nly tables i have.&lt;/P&gt;&lt;P&gt;Employers_1&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Employers_2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Employers_3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Employers_4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 08:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453109#M114448</guid>
      <dc:creator>Pandu</dc:creator>
      <dc:date>2018-04-11T08:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453111#M114450</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/126880"&gt;@Pandu&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;But i don't have any&amp;nbsp;&lt;CODE class="  language-sas"&gt;vmembers exist in abcd library like Sashelp.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="  language-sas"&gt;under&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;STRONG&gt;abcd&lt;/STRONG&gt;&amp;nbsp; library i have these are the nly tables i have.&lt;/P&gt;
&lt;P&gt;Employers_1&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Employers_2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Employers_3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Employers_4&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;look for library named &lt;STRONG&gt;sashelp&lt;/STRONG&gt;, there you will find the table &lt;STRONG&gt;vmembers&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 09:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453111#M114450</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-11T09:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453151#M114470</link>
      <description>&lt;P&gt;Thank you for your help..Its working for me as i expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 11:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453151#M114470</guid>
      <dc:creator>Pandu</dc:creator>
      <dc:date>2018-04-11T11:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Employers_1, employers_2 etc...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453152#M114471</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you for your help..Its working for me as i expected.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 11:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Employers-1-employers-2-etc/m-p/453152#M114471</guid>
      <dc:creator>Pandu</dc:creator>
      <dc:date>2018-04-11T11:46:10Z</dc:date>
    </item>
  </channel>
</rss>

