<?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: How to create new variables from an existing date variable in a dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408388#M99678</link>
    <description>&lt;PRE&gt;bday2009=mdy(month(birth_date),day(birth_date),2009);&lt;/PRE&gt;</description>
    <pubDate>Sun, 29 Oct 2017 18:47:26 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-10-29T18:47:26Z</dc:date>
    <item>
      <title>How to create new variables from an existing date variable in a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408366#M99658</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a set of data with customer name, birth_date. I need to create a few new variables, Bday2009, BdayDOW2009 and Age2009.&lt;/P&gt;&lt;P&gt;How shall I write the codes?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Bday2009&lt;/STRONG&gt; is the combination of the month of Birth_date, the day of Birth_date and the constant of 2009 in the MDY function.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;BdayDOW2009&lt;/STRONG&gt; is the day of week of Bday2009,&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Age2009&lt;/STRONG&gt; is the age of the customer in 2009, Subtract Birth_date from Bday2009 and divide the result by 365.25.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pardon as I am new to SAS and this is my school assignment which am now having diffculities in solving. Thanks advance for any help given.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 17:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408366#M99658</guid>
      <dc:creator>BabyWS77</dc:creator>
      <dc:date>2017-10-29T17:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new variables from an existing date variable in a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408369#M99659</link>
      <description>&lt;P&gt;Show us examples of what you have tried.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 17:53:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408369#M99659</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-29T17:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new variables from an existing date variable in a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408383#M99673</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the Birth_date is in date9, format (example; 12July1974),&lt;/P&gt;&lt;P&gt;i am stacked at&amp;nbsp;creating the Bday2009 variables as I need to combine the day and month of birth_date with a constant year of 2009,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried:&lt;/P&gt;&lt;P&gt;Birth_date=myd(month,3, day,2, year,4);&lt;/P&gt;&lt;P&gt;year= ‘2009’;&lt;/P&gt;&lt;P&gt;Bday2009=day month year;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried several ways but still can’t get it...&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 18:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408383#M99673</guid>
      <dc:creator>BabyWS77</dc:creator>
      <dc:date>2017-10-29T18:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new variables from an existing date variable in a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408388#M99678</link>
      <description>&lt;PRE&gt;bday2009=mdy(month(birth_date),day(birth_date),2009);&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Oct 2017 18:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408388#M99678</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-29T18:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new variables from an existing date variable in a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408390#M99680</link>
      <description>&lt;P&gt;Ok, will try it. Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 18:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-new-variables-from-an-existing-date-variable-in-a/m-p/408390#M99680</guid>
      <dc:creator>BabyWS77</dc:creator>
      <dc:date>2017-10-29T18:52:23Z</dc:date>
    </item>
  </channel>
</rss>

