<?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 convert date to numeric in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295973#M60175</link>
    <description>&lt;P&gt;Your code looks correct as is.&amp;nbsp; What happens when you run it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you run a PROC CONTENTS to verify that this hasn't already been done?&amp;nbsp; Maybe HOSP_ADM is already numeric, with a DATE9 format used for printing.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 19:11:31 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-09-01T19:11:31Z</dc:date>
    <item>
      <title>How to convert date to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295961#M60171</link>
      <description>&lt;P&gt;Hello I have this variable&amp;nbsp;&lt;SPAN&gt;Hosp_adm which I want to convert to nummeric.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The data is below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SAS Output&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.BASELINE" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Hosp_adm&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;25JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;27JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;27JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;11JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="r data"&gt;28JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;
&lt;TD class="r data"&gt;29JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;
&lt;TD class="r data"&gt;29JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;8&lt;/TH&gt;
&lt;TD class="r data"&gt;29JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;9&lt;/TH&gt;
&lt;TD class="r data"&gt;31JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;10&lt;/TH&gt;
&lt;TD class="r data"&gt;28JUL2016&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data baseline;&lt;BR /&gt;set baseline;&lt;BR /&gt;new_Hosp_adm=input(Hosp_adm, date9.);&lt;BR /&gt;format new_Hosp_adm date9.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please can anyone correct the code for me???&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 18:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295961#M60171</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2016-09-01T18:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert date to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295973#M60175</link>
      <description>&lt;P&gt;Your code looks correct as is.&amp;nbsp; What happens when you run it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you run a PROC CONTENTS to verify that this hasn't already been done?&amp;nbsp; Maybe HOSP_ADM is already numeric, with a DATE9 format used for printing.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 19:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295973#M60175</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-01T19:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert date to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295977#M60176</link>
      <description>&lt;P&gt;SAS stores calendar dates as numeric values. That is, a date is stored as a value that represents the number of days since the calendar date January 1, 1960. For example, the value for January 1, 1960 is 0. The value for January 1, 1961 is 366.&amp;nbsp;SAS converts date values back and forth between calendar dates with&amp;nbsp;SAS&amp;nbsp;informats and formats. If you do a PROC CONTENTS on your data set, you will probably see that the variable&amp;nbsp;is a numeric with an informat applied to it. You should be able to perform calculations on the column. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 19:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295977#M60176</guid>
      <dc:creator>DWarner</dc:creator>
      <dc:date>2016-09-01T19:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert date to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295987#M60178</link>
      <description>&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 19:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-date-to-numeric/m-p/295987#M60178</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2016-09-01T19:44:11Z</dc:date>
    </item>
  </channel>
</rss>

