<?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: Convert DATE9. to MMDDYY10 in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697299#M25373</link>
    <description>&lt;P&gt;You cannot "rename" a variable to a different type.&lt;/P&gt;
&lt;P&gt;Remove the complete RENAME= dataset option, and your code should work.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Nov 2020 06:38:53 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-07T06:38:53Z</dc:date>
    <item>
      <title>Convert DATE9. to MMDDYY10</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697296#M25372</link>
      <description>&lt;P&gt;I am changing the current variable name of DOB (character) to BirthDt (numeric). The DOB variable is listed in DATE9. and I am trying to change it to MMDDYY10, but keep receiving an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.D;&lt;BR /&gt;SET Hyp.M( KEEP = SocSecNum Gender Eth Racial DOB&lt;BR /&gt;RENAME = ( SocSecNum = SSN&lt;BR /&gt;DOB = BirthDt));&lt;BR /&gt;LENGTH SSN $11&lt;BR /&gt;GenderCd 8&lt;BR /&gt;EthCd $1&lt;BR /&gt;RaceCd $1&lt;BR /&gt;EthRaceCd $3;&lt;BR /&gt;&lt;BR /&gt;IF Gender = 'Male' THEN GenderCd = 1;&lt;BR /&gt;ELSE IF Gender = 'Female' THEN GenderCd = 2;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;IF Eth = 'Hispanic or Latino' THEN EthCd = 'H';&lt;BR /&gt;ELSE IF Eth = 'Not Hispanic or Latino' THEN EthCd = 'N';&lt;/P&gt;&lt;P&gt;IF MISSING(Racial) = 1 THEN RaceCd = ' ';&lt;BR /&gt;ELSE IF Racial = 'Caucasian' THEN RaceCd = 'W';&lt;BR /&gt;ELSE IF Racial = 'African American' THEN RaceCd = 'B';&lt;BR /&gt;ELSE IF Racial = 'Other Race' THEN RaceCd = 'O';&lt;/P&gt;&lt;P&gt;IF Eth = 'Hispanic or Latino' THEN EthRaceCd = 'HIS';&lt;BR /&gt;ELSE IF Racial = 'African American' THEN EthRaceCd = 'NHB';&lt;BR /&gt;ELSE IF Racial = 'Caucasian' THEN EthRaceCd = 'NHW';&lt;BR /&gt;ELSE IF Racial = 'Other Race' THEN EthRaceCd = 'NHO';&lt;/P&gt;&lt;P&gt;BirthDt = INPUT(DOB, ANYDTDTE32.);&lt;BR /&gt;Format BirthDt MMDDYY10.;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-11-06 at 10.13.57 PM.png" style="width: 0px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51479i6AB54C0D7D9862FC/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="Screen Shot 2020-11-06 at 10.13.57 PM.png" alt="Screen Shot 2020-11-06 at 10.13.57 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my log:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-11-06 at 10.13.10 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51477i7A9552BF4E17AC73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-11-06 at 10.13.10 PM.png" alt="Screen Shot 2020-11-06 at 10.13.10 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's the first line of data I am working from:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-11-06 at 10.15.13 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51480iD8A5DA9F06E0594F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-11-06 at 10.15.13 PM.png" alt="Screen Shot 2020-11-06 at 10.15.13 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; the 22JAN1974 to 01/22/1974&lt;/P&gt;&lt;P&gt;I'm not sure what I am missing, I suspect my variable is still not converting from character to numeric, but thought that the INPUT statement would do that... any advice would be great, thanks in advance!&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697296#M25372</guid>
      <dc:creator>neeloofar</dc:creator>
      <dc:date>2020-12-10T15:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DATE9. to MMDDYY10</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697299#M25373</link>
      <description>&lt;P&gt;You cannot "rename" a variable to a different type.&lt;/P&gt;
&lt;P&gt;Remove the complete RENAME= dataset option, and your code should work.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 06:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697299#M25373</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-07T06:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DATE9. to MMDDYY10</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697307#M25374</link>
      <description>&lt;P&gt;PS are you, by any means, working on the same project as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/349942"&gt;@Krissy217&lt;/a&gt;&amp;nbsp;or &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350113"&gt;@rodrima4&lt;/a&gt;&amp;nbsp;? Your datasets look quite similar.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 07:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697307#M25374</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-07T07:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DATE9. to MMDDYY10</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697351#M25387</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 17:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Convert-DATE9-to-MMDDYY10/m-p/697351#M25387</guid>
      <dc:creator>neeloofar</dc:creator>
      <dc:date>2020-11-07T17:47:41Z</dc:date>
    </item>
  </channel>
</rss>

