<?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: Formatting dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/250986#M47355</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SNL;
length host $ 18;
input Host &amp;amp; $ Appearances First: mmddyy10. Fifth: date8.;
datalines;
Ben Affleck  5 2/19/2000 18-May-13
Alec Baldwin  16 4/21/1990 10-Dec-94
Drew Barrymore  6 11/20/1982 03-Feb-07
Candice Bergen  5 11/8/1975 19-May-90
Chevy Chase  8 2/18/1978 06-Dec-86
Danny DeVito  6 5/15/1982 09-Jan-93
John Goodman  13 12/2/1989 07-May-94
Elliott Gould  6 1/10/1976 16-Feb-80
Tom Hanks  8 12/14/1985 08-Dec-90
Buck Henry  10 1/17/1976 19-Nov-77
Steve Martin  15 10/23/1976 22-Apr-78
Bill Murray  5 3/7/1981 20-Feb-99
Justin Timberlake  5 10/11/2003 09-Mar-13
Christopher Walken  7 1/20/1990 19-May-01
;
run;
proc print data=snl;
format first ddmmyy8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Feb 2016 23:54:57 GMT</pubDate>
    <dc:creator>mohamed_zaki</dc:creator>
    <dc:date>2016-02-18T23:54:57Z</dc:date>
    <item>
      <title>Formatting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/250982#M47353</link>
      <description>&lt;P&gt;I am trying to format dates into sas. I tried to format the input statement to accurately read in the dates but the variable 'first' will not show in the output data. I understand how to format the proc print (i think). Please help i dont understand why it wont work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code is listed below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data SNL;&lt;BR /&gt;length host $ 18;&lt;BR /&gt;input Host $ &amp;amp; Appearances @28 First mmddyyyy10. @44 Fifth date9.;&lt;BR /&gt;format first fifth mmddyy8.;&lt;BR /&gt;datalines;&lt;BR /&gt;Ben Affleck 5 2/19/2000 18-May-13&lt;BR /&gt;Alec Baldwin 16 4/21/1990 10-Dec-94&lt;BR /&gt;Drew Barrymore 6 11/20/1982 03-Feb-07&lt;BR /&gt;Candice Bergen 5 11/8/1975 19-May-90&lt;BR /&gt;Chevy Chase 8 2/18/1978 06-Dec-86&lt;BR /&gt;Danny DeVito 6 5/15/1982 09-Jan-93&lt;BR /&gt;John Goodman 13 12/2/1989 07-May-94&lt;BR /&gt;Elliott Gould 6 1/10/1976 16-Feb-80&lt;BR /&gt;Tom Hanks 8 12/14/1985 08-Dec-90&lt;BR /&gt;Buck Henry 10 1/17/1976 19-Nov-77&lt;BR /&gt;Steve Martin 15 10/23/1976 22-Apr-78&lt;BR /&gt;Bill Murray 5 3/7/1981 20-Feb-99&lt;BR /&gt;Justin Timberlake 5 10/11/2003 09-Mar-13&lt;BR /&gt;Christopher Walken 7 1/20/1990 19-May-01&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=snl;&lt;BR /&gt;format first ddmmyy8.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 23:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/250982#M47353</guid>
      <dc:creator>MadQuidd</dc:creator>
      <dc:date>2016-02-18T23:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/250986#M47355</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SNL;
length host $ 18;
input Host &amp;amp; $ Appearances First: mmddyy10. Fifth: date8.;
datalines;
Ben Affleck  5 2/19/2000 18-May-13
Alec Baldwin  16 4/21/1990 10-Dec-94
Drew Barrymore  6 11/20/1982 03-Feb-07
Candice Bergen  5 11/8/1975 19-May-90
Chevy Chase  8 2/18/1978 06-Dec-86
Danny DeVito  6 5/15/1982 09-Jan-93
John Goodman  13 12/2/1989 07-May-94
Elliott Gould  6 1/10/1976 16-Feb-80
Tom Hanks  8 12/14/1985 08-Dec-90
Buck Henry  10 1/17/1976 19-Nov-77
Steve Martin  15 10/23/1976 22-Apr-78
Bill Murray  5 3/7/1981 20-Feb-99
Justin Timberlake  5 10/11/2003 09-Mar-13
Christopher Walken  7 1/20/1990 19-May-01
;
run;
proc print data=snl;
format first ddmmyy8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Feb 2016 23:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/250986#M47355</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-18T23:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/251015#M47367</link>
      <description>&lt;P&gt;Possibly too late for the "why" but for later readers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This input statement:&lt;/P&gt;
&lt;P&gt;input Host $ &amp;amp; Appearances @28 First mmddyyyy10. @44 Fifth date9.;&lt;/P&gt;
&lt;P&gt;Says to always start reading the variable first in column 28.&lt;/P&gt;
&lt;P&gt;It is important to note that if the data has tabs a tab character well generally be treated as a single character so you need to count actual character spaces used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple by eye inspection of the posted data would tell us that the first date value appears in different positions.&lt;/P&gt;
&lt;P&gt;In the first line of the example data I count 15 columns for the start of first. Even without running the program I expect to get a number of errors about invalid data.&lt;/P&gt;
&lt;P&gt;Posting the log with messages would help diagnose specific issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49185"&gt;@mohamed_zaki﻿&lt;/a&gt; provided uses modified list input instead of fixed column to address that issue.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 04:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-dates/m-p/251015#M47367</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-19T04:23:37Z</dc:date>
    </item>
  </channel>
</rss>

