<?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: Date: Converting a character variable into numeric format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675821#M203656</link>
    <description>&lt;P&gt;It seems that you are using the wrong informat, ddmmyy requires the month to be a number from 1 to 12, not the abbreviated month name. Unfortunately you have not posted the data in usable form, so i won't provide code. Maybe reading those dates is possible with date9-informat after applying compress-function to dateint removing the hyphens.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2020 05:48:41 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-08-11T05:48:41Z</dc:date>
    <item>
      <title>Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675820#M203655</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am needing to convert the "DATEINT" variable into a numeric, date format (mmddyy10.) however I am having trouble doing so.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WAVE5_8LD;&lt;BR /&gt;SET WAVE5_8L;&lt;BR /&gt;NDATEINT= INPUT(DATEINT,DDMMYY10.);&lt;BR /&gt;FORMAT DATEINT MMDDYY10.;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to format "DATEINT" &amp;nbsp;to match how variable "dod" is so that I can perform an analysis on them. This is from a pre-existing dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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-08-11 at 12.09.25 AM.png" style="width: 284px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48120iAC5C59F57927DA10/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-08-11 at 12.09.25 AM.png" alt="Screen Shot 2020-08-11 at 12.09.25 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-08-11 at 12.09.39 AM.png" style="width: 482px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48119i117293E547381143/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-08-11 at 12.09.39 AM.png" alt="Screen Shot 2020-08-11 at 12.09.39 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-08-11 at 12.09.32 AM.png" style="width: 478px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48118i19BAE308E935F867/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-08-11 at 12.09.32 AM.png" alt="Screen Shot 2020-08-11 at 12.09.32 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 05:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675820#M203655</guid>
      <dc:creator>RRzio11</dc:creator>
      <dc:date>2020-08-11T05:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675821#M203656</link>
      <description>&lt;P&gt;It seems that you are using the wrong informat, ddmmyy requires the month to be a number from 1 to 12, not the abbreviated month name. Unfortunately you have not posted the data in usable form, so i won't provide code. Maybe reading those dates is possible with date9-informat after applying compress-function to dateint removing the hyphens.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 05:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675821#M203656</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-11T05:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675822#M203657</link>
      <description>&lt;P&gt;You can apply the DATE11. format directly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
dateint = "11-Aug-2020";
datenum = input(dateint,date11.);
format datenum yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Aug 2020 06:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675822#M203657</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-11T06:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675825#M203660</link>
      <description>&lt;P&gt;attached is my dataset&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 06:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675825#M203660</guid>
      <dc:creator>RRzio11</dc:creator>
      <dc:date>2020-08-11T06:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675826#M203661</link>
      <description>&lt;P&gt;Read like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile '/folders/myfolders/WAVE5_8L.csv' dlm=',' dsd firstobs=2;
input
  q_no $
  isdead
  agedie
  dod :mmddyy10.
  YSMOKE
  wave
  DATEINT :date11.
  UM
  UG
  TOTMMSE
  TOTADL
  sfrailcatb
  sex
  nfrac
  marstat
  ll
  lcancr
  khyper
  jstrok
  icardi
  cesdtot
  bmi
  age
  mdiab
;
format dod dateint yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Aug 2020 06:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675826#M203661</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-11T06:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675828#M203662</link>
      <description>Thank you so much! could you help me calculate the difference between "Dateint" and "DOD" in days?</description>
      <pubDate>Tue, 11 Aug 2020 06:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675828#M203662</guid>
      <dc:creator>RRzio11</dc:creator>
      <dc:date>2020-08-11T06:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date: Converting a character variable into numeric format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675835#M203667</link>
      <description>&lt;P&gt;SAS dates are counts of days, so you only need a simple subtraction.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 07:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Converting-a-character-variable-into-numeric-format/m-p/675835#M203667</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-11T07:27:19Z</dc:date>
    </item>
  </channel>
</rss>

