<?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: dateofbirth format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665919#M22948</link>
    <description>&lt;P&gt;If the variable is character it would be better just create a SAS date variable and assign the desired format for use.&lt;/P&gt;
&lt;P&gt;If the variable is already as SAS date variable use the mmddyy10. format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best is to run Proc Contents on your data set and share the properties of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of creating a SAS date valued variable from a character version:&lt;/P&gt;
&lt;PRE&gt;data have;
  input x :$12. ;
datalines;
1950-04-13
1920-02-26
1940-03-23
;

data want;
  set have;
  datevar = input(x,yymmdd10.);
  format datevar mmddyy10.;
run;&lt;/PRE&gt;
&lt;P&gt;There are lots of existing formats to display dates with in SAS, and you can even create your own, so the SAS date valued numeric such as datevar is the better option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2020 21:19:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-06-29T21:19:51Z</dc:date>
    <item>
      <title>dateofbirth format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665916#M22946</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset with dateofbirth&lt;/P&gt;&lt;P&gt;1950-04-13&lt;/P&gt;&lt;P&gt;1920-02-26&lt;/P&gt;&lt;P&gt;1940-03-23&lt;/P&gt;&lt;P&gt;I want to change to&lt;/P&gt;&lt;P&gt;04/13/1950&lt;/P&gt;&lt;P&gt;02/26/1920&lt;/P&gt;&lt;P&gt;03/23/1940&lt;/P&gt;&lt;P&gt;can I do this? Please let me know.&lt;/P&gt;&lt;P&gt;thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 21:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665916#M22946</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2020-06-29T21:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: dateofbirth format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665917#M22947</link>
      <description>&lt;P&gt;Assuming these are actual SAS dates and not character strings, you simply need a FORMAT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format dateofbirth mmddyys10.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2020 21:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665917#M22947</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-29T21:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: dateofbirth format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665919#M22948</link>
      <description>&lt;P&gt;If the variable is character it would be better just create a SAS date variable and assign the desired format for use.&lt;/P&gt;
&lt;P&gt;If the variable is already as SAS date variable use the mmddyy10. format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best is to run Proc Contents on your data set and share the properties of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of creating a SAS date valued variable from a character version:&lt;/P&gt;
&lt;PRE&gt;data have;
  input x :$12. ;
datalines;
1950-04-13
1920-02-26
1940-03-23
;

data want;
  set have;
  datevar = input(x,yymmdd10.);
  format datevar mmddyy10.;
run;&lt;/PRE&gt;
&lt;P&gt;There are lots of existing formats to display dates with in SAS, and you can even create your own, so the SAS date valued numeric such as datevar is the better option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 21:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dateofbirth-format/m-p/665919#M22948</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-29T21:19:51Z</dc:date>
    </item>
  </channel>
</rss>

