<?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: create data set with dates values from data sets names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614282#M179521</link>
    <description>&lt;P&gt;Another way to achieve this, assuming the entry datasets are SAS datasets:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=work._all_  noprint out=content (keep= memname where=(substr(upcase(memname),1,6) = 'RAWTBL'));
run;

data want;
	set content;
	length date $8.;
	date = substr(memname,7,8);
	keep date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 29 Dec 2019 12:57:26 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2019-12-29T12:57:26Z</dc:date>
    <item>
      <title>create data set with dates values from data sets names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614276#M179518</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Let's say that I have a series multiple&amp;nbsp; data sets .&lt;/P&gt;
&lt;P&gt;The name of a typical&amp;nbsp; data set&amp;nbsp; is : RawTbl&amp;amp;date.&lt;BR /&gt;I&amp;nbsp; want to create a data set with one column called date that will contain values of all datasets names (date only)&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;Let's say that there are 5 data sets called:&lt;/P&gt;
&lt;P&gt;RawTbl28012019&lt;/P&gt;
&lt;P&gt;RawTbl15032019&lt;/P&gt;
&lt;P&gt;RawTbl15061819&lt;/P&gt;
&lt;P&gt;RawTbl27062019&lt;/P&gt;
&lt;P&gt;RawTbl13082019&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then in the created data set will be values:&lt;/P&gt;
&lt;P&gt;28012019&lt;/P&gt;
&lt;P&gt;15032019&lt;/P&gt;
&lt;P&gt;15061819&lt;/P&gt;
&lt;P&gt;27062019&lt;/P&gt;
&lt;P&gt;13082019&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 12:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614276#M179518</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-12-29T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with dates values from data sets names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614279#M179519</link>
      <description>&lt;P&gt;I assume you mean (but you should really be more clear here) that these multiple data set are SAS data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use the SET statement with the INDSNAME option to obtain a variable that includes the names of the SAS data sets used to produce each observation.&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p00hxg3x8lwivcn1f0e9axziw57y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p00fwyxqcqptpcn10ivxt1r470q1" target="_blank"&gt;https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p00hxg3x8lwivcn1f0e9axziw57y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p00fwyxqcqptpcn10ivxt1r470q1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 12:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614279#M179519</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-29T12:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with dates values from data sets names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614280#M179520</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table want as 
	select distinct substr(memname,7,8) as date
	from dictionary.tables
	where libname = "WORK" and upcase(substr(memname,1,6)) = "RAWTBL";
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Dec 2019 12:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614280#M179520</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-29T12:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with dates values from data sets names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614282#M179521</link>
      <description>&lt;P&gt;Another way to achieve this, assuming the entry datasets are SAS datasets:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=work._all_  noprint out=content (keep= memname where=(substr(upcase(memname),1,6) = 'RAWTBL'));
run;

data want;
	set content;
	length date $8.;
	date = substr(memname,7,8);
	keep date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Dec 2019 12:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-dates-values-from-data-sets-names/m-p/614282#M179521</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-29T12:57:26Z</dc:date>
    </item>
  </channel>
</rss>

