<?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: Need to convert character to date format MM/DD/YYYY in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775266#M81113</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/317497"&gt;@xliu1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to convert a character column to the date format&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1634673495639.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64860i84F08F93FF9C0C66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1634673495639.png" alt="xliu1_0-1634673495639.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The format I am looking for is 05/04/1995&lt;/P&gt;
&lt;P&gt;Here are my sas code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data degree;
set prod.shrdgmr;
grad_term=input(substr(SHRDGMR_GRAD_DATE, 1,10), mmddyy10.);
keep shrdgmr_pidm SHRDGMR_GRAD_DATE grad_term;
where shrdgmr_pidm=14921;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but the output for created column grad_term is blank&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_1-1634673648485.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64861i4F5D40A287F9C7DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_1-1634673648485.png" alt="xliu1_1-1634673648485.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Any idea how I should change the code? Thanks!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why are&amp;nbsp; you attempting to read a date that starts with the year using an Informat that starts with month????&lt;/P&gt;
&lt;P&gt;Did you read the log with all the invalid data messages??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;grad_term=input(SHRDGMR_GRAD_DATE,yymmdd10.);
format gradterm mmddyy10.;&lt;/PRE&gt;
&lt;P&gt;The Informat length of 10 says to only read the first 10 characters so the substr isn't needed. The correct Informat is.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 20:07:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-10-19T20:07:51Z</dc:date>
    <item>
      <title>Need to convert character to date format MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775263#M81112</link>
      <description>&lt;P&gt;I need to convert a character column to the date format&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1634673495639.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64860i84F08F93FF9C0C66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1634673495639.png" alt="xliu1_0-1634673495639.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The format I am looking for is 05/04/1995&lt;/P&gt;
&lt;P&gt;Here are my sas code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data degree;
set prod.shrdgmr;
grad_term=input(substr(SHRDGMR_GRAD_DATE, 1,10), mmddyy10.);
keep shrdgmr_pidm SHRDGMR_GRAD_DATE grad_term;
where shrdgmr_pidm=14921;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but the output for created column grad_term is blank&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_1-1634673648485.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64861i4F5D40A287F9C7DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_1-1634673648485.png" alt="xliu1_1-1634673648485.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Any idea how I should change the code? Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 20:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775263#M81112</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2021-10-19T20:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need to convert character to date format MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775266#M81113</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/317497"&gt;@xliu1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to convert a character column to the date format&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1634673495639.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64860i84F08F93FF9C0C66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1634673495639.png" alt="xliu1_0-1634673495639.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The format I am looking for is 05/04/1995&lt;/P&gt;
&lt;P&gt;Here are my sas code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data degree;
set prod.shrdgmr;
grad_term=input(substr(SHRDGMR_GRAD_DATE, 1,10), mmddyy10.);
keep shrdgmr_pidm SHRDGMR_GRAD_DATE grad_term;
where shrdgmr_pidm=14921;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but the output for created column grad_term is blank&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_1-1634673648485.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64861i4F5D40A287F9C7DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_1-1634673648485.png" alt="xliu1_1-1634673648485.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Any idea how I should change the code? Thanks!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why are&amp;nbsp; you attempting to read a date that starts with the year using an Informat that starts with month????&lt;/P&gt;
&lt;P&gt;Did you read the log with all the invalid data messages??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;grad_term=input(SHRDGMR_GRAD_DATE,yymmdd10.);
format gradterm mmddyy10.;&lt;/PRE&gt;
&lt;P&gt;The Informat length of 10 says to only read the first 10 characters so the substr isn't needed. The correct Informat is.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775266#M81113</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-19T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need to convert character to date format MM/DD/YYYY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775269#M81114</link>
      <description>&lt;P&gt;Thanks for your response. This works out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 20:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-convert-character-to-date-format-MM-DD-YYYY/m-p/775269#M81114</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2021-10-19T20:22:31Z</dc:date>
    </item>
  </channel>
</rss>

