<?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: Pull date from long character field in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687405#M33135</link>
    <description>&lt;P&gt;Use regular expressions matching. You can iterate the matches with prxNext:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
if not prxId then prxId + prxParse("@\d\d?/\d\d?/\d\d(\d\d)?@");
set have;
start = 1;
stop = length(text);
call prxnext(prxID, start, stop, text, position, length);
do while (position &amp;gt; 0);
    date = input(substr(text, position, length), ?? mmddyy10.);
    if not missing(date) then output;
    call prxnext(prxID, start, stop, text, position, length);
    end;
keep date;
format date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 02:40:31 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-09-29T02:40:31Z</dc:date>
    <item>
      <title>Pull date from long character field</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687371#M33132</link>
      <description>&lt;P&gt;I'd like to pull date from a long character field.&lt;/P&gt;&lt;P&gt;For instance:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="support-paragraph"&gt;Out of another, I get a lovely view of the bay on 8/23/20 and a little private wharf belonging to the estate. There is a beautiful shaded lane that runs down there from the house. I always fancy I see people walking on 5/5/20.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="support-paragraph"&gt;From this I'd like my output to be:&lt;BR /&gt;date=08/23/2020&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="support-paragraph"&gt;date=05/05/2020&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="support-paragraph"&gt;Please help. Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 00:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687371#M33132</guid>
      <dc:creator>Ja5ya</dc:creator>
      <dc:date>2020-09-29T00:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from long character field</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687374#M33133</link>
      <description>&lt;P&gt;Can a sentence be "I'll see you on the first day of November 2020" ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 01:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687374#M33133</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-09-29T01:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from long character field</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687395#M33134</link>
      <description>No, this is the data we receive so we can't change the date format.</description>
      <pubDate>Tue, 29 Sep 2020 02:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687395#M33134</guid>
      <dc:creator>Ja5ya</dc:creator>
      <dc:date>2020-09-29T02:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from long character field</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687405#M33135</link>
      <description>&lt;P&gt;Use regular expressions matching. You can iterate the matches with prxNext:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
if not prxId then prxId + prxParse("@\d\d?/\d\d?/\d\d(\d\d)?@");
set have;
start = 1;
stop = length(text);
call prxnext(prxID, start, stop, text, position, length);
do while (position &amp;gt; 0);
    date = input(substr(text, position, length), ?? mmddyy10.);
    if not missing(date) then output;
    call prxnext(prxID, start, stop, text, position, length);
    end;
keep date;
format date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 02:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687405#M33135</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-09-29T02:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from long character field</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687406#M33136</link>
      <description>Thanks for the regular expression! This worked out quite well.</description>
      <pubDate>Tue, 29 Sep 2020 03:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pull-date-from-long-character-field/m-p/687406#M33136</guid>
      <dc:creator>Ja5ya</dc:creator>
      <dc:date>2020-09-29T03:31:48Z</dc:date>
    </item>
  </channel>
</rss>

