<?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: read only date part from data set name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166362#M263782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;USE scan() with delimiter _.&amp;nbsp; and -2 as counter so extracting second last substring.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2014 07:33:10 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2014-02-07T07:33:10Z</dc:date>
    <item>
      <title>read only date part from data set name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166361#M263781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 50+ data sets having different lengths with date extension, I want to read only date part from data sets and store in a variable for time stamp. &lt;/P&gt;&lt;P&gt;pls advise me how to read date part from data set name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST_201312.sas7bdat&lt;/P&gt;&lt;P&gt;TEST__MONTH_201312.sas7bdat&lt;/P&gt;&lt;P&gt;TEST__YEAR_201312.sas7bdat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 03:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166361#M263781</guid>
      <dc:creator>chirumalla</dc:creator>
      <dc:date>2014-02-07T03:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: read only date part from data set name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166362#M263782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;USE scan() with delimiter _.&amp;nbsp; and -2 as counter so extracting second last substring.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 07:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166362#M263782</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-02-07T07:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: read only date part from data set name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166363#M263783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data TEST_201312;&lt;/P&gt;&lt;P&gt;test=1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data TEST__MONTH_201312;&lt;/P&gt;&lt;P&gt;test=1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data TEST__YEAR_201312;&lt;/P&gt;&lt;P&gt;test=1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc&amp;nbsp; sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table tab as select memname, cats(put(input(substr(left((compress(memname,,'kd'))),5,2),best.),monname3.),substr(left((compress(memname,,'kd'))),1,4)) as month_year&amp;nbsp; from dictionary.tables where upcase(memname) like "TEST%";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/4893_pastedImage_0.png" style="width: 290px; height: 72px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 11:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166363#M263783</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2014-02-07T11:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: read only date part from data set name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166364#M263784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where do want the new variable to go?&amp;nbsp; You seem to imply you want the new variable in each data set. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-only-date-part-from-data-set-name/m-p/166364#M263784</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-02-07T12:16:37Z</dc:date>
    </item>
  </channel>
</rss>

