<?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: Alphabetic prefixes for enumerated data sets are different in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435527#M108210</link>
    <description>&lt;P&gt;The enumerated part has to be the at the end of the name, so you have to remove _v00 to get the thing to work.&lt;/P&gt;
&lt;P&gt;You could change your set-statement to&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;set comm_trans_det_:;&lt;/PRE&gt;
&lt;P&gt;if you are 100% that every dataset and view beginning with "comm_trans_det_" should be appended to "all_yearly_views_from_2017".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: if you change the set statement, you can keep _v00 at the end of the names.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 06:26:15 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2018-02-09T06:26:15Z</dc:date>
    <item>
      <title>Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435525#M108208</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;24         data all_yearly_views_from_2017;
25         set COMM_TRANS_DET_2017_V00-COMM_TRANS_DET_2025_V00;
ERROR: Alphabetic prefixes for enumerated data sets (COMM_TRANS_DET_2017_V00-COMM_TRANS_DET_2025_V00) are 
       different.
26         run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Appreciate if someone of you guide me to resolve this error. Also I want to add one more portion in this code. If any of the the views between the year 2017 and 2025 is not available (e.g. COMM_TRANS_DET_2018_V00 , COMM_TRANS_DET_2019_V00) I want the code to be successful by adding 0 observations for the views which are not available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 06:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435525#M108208</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T06:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435527#M108210</link>
      <description>&lt;P&gt;The enumerated part has to be the at the end of the name, so you have to remove _v00 to get the thing to work.&lt;/P&gt;
&lt;P&gt;You could change your set-statement to&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;set comm_trans_det_:;&lt;/PRE&gt;
&lt;P&gt;if you are 100% that every dataset and view beginning with "comm_trans_det_" should be appended to "all_yearly_views_from_2017".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: if you change the set statement, you can keep _v00 at the end of the names.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 06:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435527#M108210</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-02-09T06:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435531#M108212</link>
      <description>&lt;P&gt;&amp;nbsp;I don't want to remove _v00 in the view name.&amp;nbsp;If I add the following statement, it will append all the views, but I want to append the views only from 2017. Any idea on the second part of my question?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;set comm_trans_det_:;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 06:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435531#M108212</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T06:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435535#M108213</link>
      <description>&lt;P&gt;Easy option - rename your datasets to comm_trans_det_V00_yyyy (eg 2017).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Harder option - use dictionary tables in an SQL query to create the exact list of datasets you want and assign the list to a macro variable which is then used on your SET statement instead of actual dataset names. There are plenty of examples in other posts of this technique.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 08:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435535#M108213</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-02-09T08:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435539#M108214</link>
      <description>&lt;P&gt;I find hard to find the document/posts which you're talking about. Could you please point me with the link for the document which you wanted to mention?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 08:12:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435539#M108214</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435542#M108215</link>
      <description>&lt;P&gt;Untested:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select distinct memname
  into :table_list separated by ' '
  from dictionary.tables &lt;BR /&gt;  where memname contains '2017';
quit;

data want;
  set &amp;amp;table_list;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Feb 2018 08:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435542#M108215</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-02-09T08:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435557#M108217</link>
      <description>&lt;P&gt;Try this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Build_Tables;
%do yr=2017 %to 2025;
  data COMM_TRANS_DET_&amp;amp;&amp;amp;yr._V00;
    year=&amp;amp;&amp;amp;yr.;
  run;
%end;

data ALL_TABLES;
  set 
    %do yr=2017 %to 2025;
       COMM_TRANS_DET_&amp;amp;&amp;amp;yr._V00
    %end; ;
run;
%mend;
%Build_Tables;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope it works.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 08:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435557#M108217</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2018-02-09T08:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435565#M108221</link>
      <description>&lt;P&gt;I think you're on to something here.&amp;nbsp; Perhaps the requirements call for something more like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where upcase(memname) &amp;gt;= 'COMM_TRANS_DET_2017'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; and upcase(memname) &amp;lt; 'COMM_TRANS_DET_2026'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; and upcase(memname) contains '_V00'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435565#M108221</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-09T12:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435613#M108231</link>
      <description>&lt;P&gt;Thank you, code seem to be working fine. Is there a way to tweak the code in other way? Because I see that the code seem to take more time (due to querying dictionary.tables?) for completion.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435613#M108231</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T12:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435616#M108233</link>
      <description>&lt;P&gt;How to tweak your code if I've to append the permanent datasets which are available in non-work library?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435616#M108233</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T12:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435618#M108234</link>
      <description>&lt;P&gt;Notice a slight change to the code I posted (&amp;lt; 2026 instead of &amp;lt;= 2025).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To speed it up you can test whether it would be faster to exract from sashelp.vtable instead of dictionary.tables.&amp;nbsp; That's about all I can think of.&amp;nbsp; One is a view, the other a data set ... the data set should be faster but I forget which is which.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435618#M108234</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-09T12:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435622#M108237</link>
      <description>&lt;P&gt;sure, I will give a try.&amp;nbsp;&lt;SPAN&gt;How to tweak your code if I've to append the permanent datasets which are available in non-work library?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435622#M108237</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T12:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435624#M108238</link>
      <description>&lt;P&gt;select distinct('libname.' || memname)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to replace libname with the actual libname that you are using.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435624#M108238</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-09T12:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435686#M108254</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, code seem to be working fine. Is there a way to tweak the code in other way? Because I see that the code seem to take more time (due to querying dictionary.tables?) for completion.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Make sure to include LIBNAME in your WHERE clause to prevent SAS from having to scan every libname to check what members it has.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select distinct memname
  into :table_list separated by ' '
  from dictionary.tables
  where libname = 'WORK'
    and memname contains '2017'
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or just generate a macro variable with the names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length dslist $1000;
  do yr=2017 to 2025;
   dslist=catx(' ',dslist,catx('_','COMM_TRANS_DET',yr,'V00'));
  end;
  call symputx('dslist',dslist);
run;

data want;
  set &amp;amp;dslist ;
  ....&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435686#M108254</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-02-09T16:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetic prefixes for enumerated data sets are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435700#M108261</link>
      <description>&lt;P&gt;You can tweak it by using PROC DATASETS to generate the list of data sets instead of using SASHELP.VTABLE. If you have a lot of libraries and data sets querying SASHELP or DICTIONARY will take a while.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;sure, I will give a try.&amp;nbsp;&lt;SPAN&gt;How to tweak your code if I've to append the permanent datasets which are available in non-work library?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:36:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alphabetic-prefixes-for-enumerated-data-sets-are-different/m-p/435700#M108261</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-09T16:36:41Z</dc:date>
    </item>
  </channel>
</rss>

