<?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 Convert dates in a text field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16684#M2343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The regular expression can be rewritten as /\d{4}-\d{2}-\d{2}/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can use prxsubstr instead of prxmatch to help with the collection of the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Dec 2011 20:39:39 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2011-12-16T20:39:39Z</dc:date>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16675#M2334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am starting with a variable that has fully formed SQL logic in it.&lt;/P&gt;&lt;P&gt;For example, Select * From Trans where Trans_date &amp;gt;= '2011-01-01'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Trans table is now a local SAS data set, so to run the SQL stored in the variable, I need to change the date format from 'YYYY-MM-DD' to 'd-mmm-yy'd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can do this if I create a lookup table for each date value and use tranwrd to replace them all but it seems to me there would be a more elegant way of doing this.&lt;/P&gt;&lt;P&gt;Since the dates are stored in the text field with the rest of the logic, perhaps trnwrd is the best way to go. Can I get your thoughts/solutions on how best to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 14:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16675#M2334</guid>
      <dc:creator>Mishka1</dc:creator>
      <dc:date>2011-12-16T14:18:58Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16676#M2335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If all of your statements are like the one shown in your example, you might be able to use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat current $60.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input current &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Select * From Trans where Trans_date &amp;gt;= '2011-01-01'&lt;/P&gt;&lt;P&gt;Select * From Trans where Trans_date &amp;gt;= '2011-02-02'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (drop=x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x=index(current,"'");&lt;/P&gt;&lt;P&gt;&amp;nbsp; need=catt(substr(current,1,x-1),"'",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put(input(compress(substr(current,x),"'"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; anydtdte12.),date9.),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "'d");&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 14:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16676#M2335</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-16T14:33:27Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16677#M2336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I like that! I do have some competing fields for that index though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a more real world example. I should have known enough to include it the first time, sorry:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * From Trans where&lt;/P&gt;&lt;P&gt;Field1 &amp;lt;&amp;gt; 'D1' AND &lt;/P&gt;&lt;P&gt;Field2 &amp;lt;&amp;gt; 13 AND Field2 &amp;lt;&amp;gt; 61 AND Field2 &amp;lt;&amp;gt; 86 AND &lt;/P&gt;&lt;P&gt;Field3 &amp;lt;&amp;gt; '02' AND Field3 &amp;lt;&amp;gt; '16' AND Field3 &amp;lt;&amp;gt; '86' AND &lt;/P&gt;&lt;P&gt;Tran_dt &amp;gt; '2011-03-26' AND Tran_dt &amp;lt; '2011-04-23'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 15:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16677#M2336</guid>
      <dc:creator>Mishka1</dc:creator>
      <dc:date>2011-12-16T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16678#M2337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am only learning regular expressions, thus I'm sure that a more elegant way of writing the following exists.&amp;nbsp; However, it does work for your examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*The following file contains all of your examples*/&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat current $250.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile "c:\trans.txt" lrecl=260;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input current &amp;amp;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options datestyle=ymd;&lt;/P&gt;&lt;P&gt;data want (drop=x _:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _dt_pattern_num=prxparse(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "/\d\d\d\d\-\d\d\-\d\d/o");&lt;/P&gt;&lt;P&gt;&amp;nbsp; x=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (x gt 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = prxmatch(_dt_pattern_num,current);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* If found, then parse date */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; current=catt(substr(current,1,x-1),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put(input(substr(current,x,10),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; anydtdte12.),date9.),"'d",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(current,x+11));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 16:56:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16678#M2337</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-16T16:56:25Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16679#M2338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; while Art was working on his, I was working on this (someday I'll get into these prx.... but for now, &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; line =_infile_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;list&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;cards4&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Select * From Trans where&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Field1 &amp;lt;&amp;gt; 'D1' AND &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Field2 &amp;lt;&amp;gt; 13 AND Field2 &amp;lt;&amp;gt; 61 AND Field2 &amp;lt;&amp;gt; 86 AND &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Field3 &amp;lt;&amp;gt; '02' AND Field3 &amp;lt;&amp;gt; '16' AND Field3 &amp;lt;&amp;gt; '86' AND &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Tran_dt &amp;gt; '2011-03-26' AND Tran_dt &amp;lt; '2011-04-23'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Select * From Trans where&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Field1 &amp;lt;&amp;gt; 'D1' AND &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Tran_dt &amp;gt; '2011-11-01'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; date_pos = find( line, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;'tran_dt'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;'i'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; do&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(date_pos);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; old1 = scan( substr( line, date_pos), &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;"'"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open_pos = find( line, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;"'"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,date_pos);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clos_pos = find( line, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;"'"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,open_pos +&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr( line, open_pos+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;11&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;) = put( input( old1, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 9pt;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 9pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;) !! &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;"'d"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date_pos = find( line, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;'tran_dt'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 9pt;"&gt;'i'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;, clos_pos );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 9pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this works by replacing the 'yyyy-mm-dd' with 'ddMMMyyyy'd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 17:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16679#M2338</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-16T17:12:58Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16680#M2339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Works right out of the box. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 17:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16680#M2339</guid>
      <dc:creator>Mishka1</dc:creator>
      <dc:date>2011-12-16T17:51:39Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16681#M2340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; For only just learning regular expressions, you sure do a good job of making stuff that works. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 17:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16681#M2340</guid>
      <dc:creator>Mishka1</dc:creator>
      <dc:date>2011-12-16T17:57:13Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16682#M2341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both Peter's and my solutions should work right out of the box (at least for dates that appear as yyyy-mm-dd, but, realize that the regular expression method would be better if there is more than one date variable.&amp;nbsp; Peter's code would have to be expanded if you had, say, tran_dt and recv_dt or the like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 18:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16682#M2341</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-16T18:46:22Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16683#M2342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right. Having the ability to add new dates without re-coding is the way to go.&lt;/P&gt;&lt;P&gt;When using your solution, it retains the trailing single quote. All the dates are correctly replaced but look like this '25NOV2011'd'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to alter your code to remove the single quote after the d?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 19:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16683#M2342</guid>
      <dc:creator>Mishka1</dc:creator>
      <dc:date>2011-12-16T19:46:01Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16684#M2343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The regular expression can be rewritten as /\d{4}-\d{2}-\d{2}/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can use prxsubstr instead of prxmatch to help with the collection of the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 20:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16684#M2343</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-16T20:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16685#M2344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, there was an error in my original code.&amp;nbsp; I just changed it and the extra quote is now removed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 21:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16685#M2344</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-16T21:04:57Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16686#M2345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Ah ha! I got it.&lt;/P&gt;&lt;P&gt;I had to increase the substring constant.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;substr(FDWCQueues,x+ &lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;11&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;SPAN style=": ; font-size: 2; font-family: 'Courier New';"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 21:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16686#M2345</guid>
      <dc:creator>Mishka1</dc:creator>
      <dc:date>2011-12-16T21:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16687#M2346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data have;
&amp;nbsp;&amp;nbsp; input;
&amp;nbsp;&amp;nbsp; line =_infile_;
&amp;nbsp;&amp;nbsp; list; cards4;
Select * From Trans where
Field1 &amp;lt;&amp;gt; 'D1' AND
Field2 &amp;lt;&amp;gt; 13 AND Field2 &amp;lt;&amp;gt; 61 AND Field2 &amp;lt;&amp;gt; 86 AND
Field3 &amp;lt;&amp;gt; '02' AND Field3 &amp;lt;&amp;gt; '16' AND Field3 &amp;lt;&amp;gt; '86' AND
Tran_dt &amp;gt; '2011-03-26' AND Tran_dt &amp;lt; '2011-04-23'
;
Select * From Trans where
Field1 &amp;lt;&amp;gt; 'D1' AND
Tran_dt &amp;gt; '2011-11-01'
;
;;;;
run;
data want(keep=line);
 set have;
 pid=prxparse("/'\s*\d{4}\s*-\s*\d{1,2}\s*-\s*\d{1,2}\s*'/o");
 start=1;stop=length(line);
 call prxnext(pid,start,stop,line,position,length);
 do while(position &amp;gt; 0);
 date=put(input(dequote(substr(line,position,length)),yymmdd20.),date9.);
 line=substr(line,1,position-1)||quote(date)||'d'||substr(line,position+length);
 call prxnext(pid,start,stop,line,position,length);
 end;
run;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 06:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16687#M2346</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-19T06:19:31Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16688#M2347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;very good, supporting any single quoted date of form yyyy-mm-dd or yyyy-m-d and with or without a variable name nearby &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 18:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16688#M2347</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-19T18:48:21Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16689#M2348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome.&amp;nbsp; Peter. &lt;/P&gt;&lt;P&gt;Merry Christmas!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 03:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16689#M2348</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-20T03:10:22Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16690#M2349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;KSharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you explain your regular expression?&amp;nbsp; Appreciated, Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 05:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16690#M2349</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-20T05:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16691#M2350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art&lt;/P&gt;&lt;P&gt;/'\s*\d{4}\s*-\s*\d{1,2}\s*-\s*\d{1,2}\s*'/o&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\s*&amp;nbsp; means matching zero or more times SPACE character.&lt;/P&gt;&lt;P&gt;\d{4}&amp;nbsp; means matching exactly four digits.&lt;/P&gt;&lt;P&gt;\d{1,2}&amp;nbsp;&amp;nbsp;&amp;nbsp; means matching one to&amp;nbsp; two&amp;nbsp; times digits(i.e.&amp;nbsp;&amp;nbsp; \d or \d\d)&lt;/P&gt;&lt;P&gt;o&amp;nbsp; means only compiling perl regular expression once.&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp; means matching exactly - character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'&amp;nbsp;&amp;nbsp; means matching exactly ' character&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 06:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16691#M2350</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-20T06:07:42Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16692#M2351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Just for the fun of it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want(keep=line);&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; line=prxchange("s/'(\d{4})-(\d+)-(\d+)'/%nrbquote(%)sysfunc(inputn($3$2$1,ddmmyy8.))/o", -1, line); &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 10:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16692#M2351</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-12-20T10:31:14Z</dc:date>
    </item>
    <item>
      <title>Convert dates in a text field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16693#M2352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick.&lt;/P&gt;&lt;P&gt;It is very interesting. I don't realize that changing it into a macro function.&lt;/P&gt;&lt;P&gt;But there is a problem. Your way will make line longer, if the length of original line is not long enough to hold these macro function. then it will be truncated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, It is an interesting solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy Christmas !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 02:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-in-a-text-field/m-p/16693#M2352</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-21T02:55:37Z</dc:date>
    </item>
  </channel>
</rss>

