<?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: Character to SAS Date Conversion?? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49173#M13342</link>
    <description>Are you using the correct format?&lt;BR /&gt;
&lt;BR /&gt;
This works, but may not be what you ask for....&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 a = today();&lt;BR /&gt;
 put a EURDFMY7.;&lt;BR /&gt;
 b = 'jun 2010';&lt;BR /&gt;
 c = input(compress(b),EURDFMY7.);&lt;BR /&gt;
 put c yymmdd10.;&lt;BR /&gt;
run;</description>
    <pubDate>Wed, 14 Jul 2010 12:41:05 GMT</pubDate>
    <dc:creator>FredrikE</dc:creator>
    <dc:date>2010-07-14T12:41:05Z</dc:date>
    <item>
      <title>Character to SAS Date Conversion??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49171#M13340</link>
      <description>I want to convert character date "JUL 2010" to Sas date value in EURDFDMY7(MMMYYYY) format.&lt;BR /&gt;
&lt;BR /&gt;
I have done the sub setting&lt;BR /&gt;
&lt;BR /&gt;
data test.datechar1;&lt;BR /&gt;
set test.datechar1;&lt;BR /&gt;
length month $3 year $4;&lt;BR /&gt;
month=substr (date,1,3); &lt;BR /&gt;
year=substr (date,5,4);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
and concantenated to remove the space between JUL and 2010.&lt;BR /&gt;
&lt;BR /&gt;
INPUT function does not seems to work for the EURDFDMY7 format in SAS version 8.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone suggest me any other method to convert character date to sas date in EURDFDMY7 format (MMMYYYY) like JUL2010 .</description>
      <pubDate>Wed, 14 Jul 2010 12:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49171#M13340</guid>
      <dc:creator>Anilsk</dc:creator>
      <dc:date>2010-07-14T12:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Character to SAS Date Conversion??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49172#M13341</link>
      <description>*---&amp;gt; create format to convert 3 char month to number.;&lt;BR /&gt;
data temp(keep=start label fmtname);&lt;BR /&gt;
retain fmtname "$month2number";&lt;BR /&gt;
start = 'JAN'; label=1; output;&lt;BR /&gt;
start = 'FEB'; label=2 output;&lt;BR /&gt;
start = 'MAR'; label=3; output;&lt;BR /&gt;
start = 'APR'; label=4; output;&lt;BR /&gt;
...etc...&lt;BR /&gt;
run;&lt;BR /&gt;
*---&amp;gt; create a temporary format;&lt;BR /&gt;
proc format cntlin=temp;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data test.datechar1;&lt;BR /&gt;
set test.datechar1;&lt;BR /&gt;
length month $3 year $4;&lt;BR /&gt;
month=substr (date,1,3); &lt;BR /&gt;
year=substr (date,5,4);&lt;BR /&gt;
*---&amp;gt; convert the month to a number.;&lt;BR /&gt;
monthn = put(month,$month2number.);&lt;BR /&gt;
*---&amp;gt; create a SAS date as though it is the first day of the month.;&lt;BR /&gt;
sasdateout = mdy(monthn,1,year);&lt;BR /&gt;
attrib sasdateout length=8 format=EURDFDMY7.;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 14 Jul 2010 12:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49172#M13341</guid>
      <dc:creator>jj030655</dc:creator>
      <dc:date>2010-07-14T12:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Character to SAS Date Conversion??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49173#M13342</link>
      <description>Are you using the correct format?&lt;BR /&gt;
&lt;BR /&gt;
This works, but may not be what you ask for....&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 a = today();&lt;BR /&gt;
 put a EURDFMY7.;&lt;BR /&gt;
 b = 'jun 2010';&lt;BR /&gt;
 c = input(compress(b),EURDFMY7.);&lt;BR /&gt;
 put c yymmdd10.;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 14 Jul 2010 12:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-SAS-Date-Conversion/m-p/49173#M13342</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2010-07-14T12:41:05Z</dc:date>
    </item>
  </channel>
</rss>

