<?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: convert number and date in the same column ,and combine to date (one variable) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374265#M89604</link>
    <description>&lt;P&gt;According to the log the date, in some rows, is not in mmddyy10. format.&lt;/P&gt;
&lt;P&gt;On line 7 the date is:&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;11/1/1997&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;On line 19 the date is &lt;STRONG&gt;1/3/1998&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;that means that day/month don't include leading zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't find an informat to convert those to dates, therefore, new suggestion:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data hockey;
  infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"
           firstobs = 2 delimiter="," dsd;

  input datex  $  
          Team $ City $ State $ OSU $ OPP $ ;

  mm = input(scan(datex,1,'/'),best2.);
  dd = input(scan(datex,2&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;,'/'&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;),best2.); &lt;BR /&gt;  yy = input(scan(datex,3,'/'),best4.); &lt;BR /&gt;  date = mdy(mm,dd,yy); &lt;BR /&gt;  drop datex; &lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 09 Jul 2017 14:32:29 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-07-09T14:32:29Z</dc:date>
    <item>
      <title>convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374219#M89574</link>
      <description>&lt;P&gt;Hello, guys&lt;/P&gt;&lt;P&gt;I have a question about how to convert data in a .csv file. I use sas&amp;nbsp;university&amp;nbsp;edition.&lt;/P&gt;&lt;P&gt;The file has one column, which has both numbers that look like (date type) (ex.10/18/1991) and date (ex.10/10/1997) in the same column.&lt;/P&gt;&lt;P&gt;My goal is combined the month, day, and year into one variable representing the date. However, I m still struggling in converting all of them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need guidelines&amp;nbsp;and help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Team&lt;/TD&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;State&lt;/TD&gt;&lt;TD&gt;OSU&lt;/TD&gt;&lt;TD&gt;OPP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/10/1997&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Toronto&lt;/TD&gt;&lt;TD&gt;Columbus&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Ohio&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/18/1997&lt;/TD&gt;&lt;TD&gt;Miami&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Oxford&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Ohio&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/24/1997&l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D&gt;Notre Dame&lt;/TD&gt;&lt;TD&gt;Columbus&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Ohio&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;PRE&gt;data hockey;&lt;BR /&gt;infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"&lt;BR /&gt;firstobs = 2 delimiter="/" dsd&lt;BR /&gt;;&lt;BR /&gt;input &lt;BR /&gt;Date DDMMYY8. Team $ City $ State $ OSU $ OPP $&lt;BR /&gt;;&lt;BR /&gt;proc&lt;BR /&gt;print data = hockey;&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14056i68BC8FF63C7F2C92/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="3.3.png" title="3.3.png" /&gt;</description>
      <pubDate>Sun, 09 Jul 2017 03:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374219#M89574</guid>
      <dc:creator>Koke</dc:creator>
      <dc:date>2017-07-09T03:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374223#M89578</link>
      <description>&lt;P&gt;You're reading in the data incorrectly. For one you assume the date is DDMMYY, when it appears to be MMDDYY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use PROC IMPORT to import the data. Look at the log. Take the code from the log and customize it as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But first, review how SAS stores dates and how format/informats work. A SAS date is a number, which represents the number of days from Jan 1, 1960. A format allows it to be shown as anything from the Month alone to the full date, as in Saturday July 8, 2017.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153082"&gt;@Koke&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello, guys&lt;/P&gt;
&lt;P&gt;I have a question about how to convert data in a .csv file. I use sas&amp;nbsp;university&amp;nbsp;edition.&lt;/P&gt;
&lt;P&gt;The file has one column, which has both numbers that look like (date type) (ex.10/18/1991) and date (ex.10/10/1997) in the same column.&lt;/P&gt;
&lt;P&gt;My goal is combined the month, day, and year into one variable representing the date. However, I m still struggling in converting all of them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need guidelines&amp;nbsp;and help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Date&lt;/TD&gt;
&lt;TD&gt;Team&lt;/TD&gt;
&lt;TD&gt;City&lt;/TD&gt;
&lt;TD&gt;State&lt;/TD&gt;
&lt;TD&gt;OSU&lt;/TD&gt;
&lt;TD&gt;OPP&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10/10/1997&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;Toronto&lt;/TD&gt;
&lt;TD&gt;Columbus&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;Ohio&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10/18/1997&lt;/TD&gt;
&lt;TD&gt;Miami&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Oxford&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;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sp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;Ohio&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;11/08/1997&lt;/TD&gt;
&lt;TD&gt;Notre Dame&lt;/TD&gt;
&lt;TD&gt;Columbus&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;Ohio&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;PRE&gt;data hockey;&lt;BR /&gt;infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"&lt;BR /&gt;firstobs = 2 delimiter="/" dsd&lt;BR /&gt;;&lt;BR /&gt;input &lt;BR /&gt;Date DDMMYY8. Team $ City $ State $ OSU $ OPP $&lt;BR /&gt;;&lt;BR /&gt;proc&lt;BR /&gt;print data = hockey;&lt;/PRE&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 04:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374223#M89578</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-09T04:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374224#M89579</link>
      <description>&lt;P&gt;You have the wrong informat for your date variable. Try it with mmddyy10.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably will want to include a format for it, as well, so that you can see that it worked. I usually like to use date9. for such formats, but any date format would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 04:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374224#M89579</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-09T04:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374249#M89591</link>
      <description>&lt;P&gt;Are you sure your input is a CSV (Comma Separated) file?&lt;/P&gt;
&lt;P&gt;YES - means your delimiter is ',' - but your code contains delimiter = '/'&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your input date seems to be in MM/DD/YYYY format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is a csv file try next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data hockey;
  infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"
           firstobs = 2 delimiter="," dsd;

  input date mmddyy10.  
          Team $ City $ State $ OSU $ OPP $ ;
run;

proc print=hockey; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Jul 2017 12:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374249#M89591</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-09T12:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374256#M89596</link>
      <description>&lt;P&gt;Thank you, Shmuel&lt;/P&gt;&lt;P&gt;I fix mistakes follow from your code. In the output, some observation in date column shows the number that I want, but some show (.).&lt;/P&gt;&lt;P&gt;So I look back to the data file.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/10/1997 (date type in csv.)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/18/1997&amp;nbsp;&lt;SPAN&gt;(general type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/24/1997&amp;nbsp;&lt;SPAN&gt;(general type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/26/1997&amp;nbsp;&lt;SPAN&gt;(general type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/31/1997&amp;nbsp;&lt;SPAN&gt;(general type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11/01/1997(&lt;SPAN&gt;date type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11/07/1997(&lt;SPAN&gt;date type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11/08/1997(&lt;SPAN&gt;date type in csv.)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an output&lt;/P&gt;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York&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;Western&lt;/TD&gt;&lt;TD&gt;Columbus&lt;/TD&gt;&lt;TD&gt;Ohio&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;Notre Da&lt;/TD&gt;&lt;TD&gt;Columbus&lt;/TD&gt;&lt;TD&gt;Ohio&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that the problem is I have both number type and date type in the same column. As a result, the (.) show in some of the column. The log shows this statement &lt;SPAN&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here all of the&amp;nbsp;log&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 data hockey;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;64 firstobs = 2 delimiter="," dsd;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;65&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 input date mmddyy10. Team $ 8. City $ State $ OSU $ OPP $ ;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;67 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv" is:&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;(no system-specific pathname available),&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;(no system-specific file attributes available)&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 7 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;7 11/1/1997,Clarkson,Potsdam , New York,6,2 41&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Clarkson City= State=Potsdam OSU=New York OPP=6 _ERROR_=1 _N_=6&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 8 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;8 11/7/1997,Western Michigan,Columbus , Ohio,1,3 46&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Western City=Michigan State=Columbus OSU=Ohio OPP=1 _ERROR_=1 _N_=7&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 9 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;9 11/8/1997,Notre Dame,Columbus , Ohio,3,2 40&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Notre Da City=me State=Columbus OSU=Ohio OPP=3 _ERROR_=1 _N_=8&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 14 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;14 12/5/1997,Alaska-Fairbanks,Columbus , Ohio,8,3 46&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Alaska-F City=airbanks State=Columbus OSU=Ohio OPP=8 _ERROR_=1 _N_=13&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 15 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;15 12/6/1997,Alaska-Fairbanks,Columbus , Ohio,4,0 46&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Alaska-F City=airbanks State=Columbus OSU=Ohio OPP=4 _ERROR_=1 _N_=14&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 18 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;18 1/2/1998,Michigan,Ann Arbor, Michigan,4,2 41&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=ichigan, City=Ann Arbo State=Michigan OSU=4 OPP=2 _ERROR_=1 _N_=17&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 19 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;19 1/3/1998,Michigan,Ann Arbor, Michigan,6,0 41&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=ichigan, City=Ann Arbo State=Michigan OSU=6 OPP=0 _ERROR_=1 _N_=18&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 20 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;20 1/9/1998,Lake Superior,Columbus , Ohio,7,0 42&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=ake Supe City=rior State=Columbus OSU=Ohio OPP=7 _ERROR_=1 _N_=19&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 21 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;21 1/10/1998,Ferris State,Columbus , Ohio,5,3 42&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Ferris S City=tate State=Columbus OSU=Ohio OPP=5 _ERROR_=1 _N_=20&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 22 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;22 1/18/1998,Bowling Green,Columbus , Ohio,4,2 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Bowling City=Green State=Columbus OSU=Ohio OPP=4 _ERROR_=1 _N_=21&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 23 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;23 1/24/1998,Northern Michigan,Columbus , Ohio,2,0 47&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Northern City=Michigan State=Columbus OSU=Ohio OPP=2 _ERROR_=1 _N_=22&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 24 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;24 1/25/1998,Notre Dame,Columbus , Ohio,5,3 40&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Notre Da City=me State=Columbus OSU=Ohio OPP=5 _ERROR_=1 _N_=23&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 25 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;25 1/30/1998,Western Michigan,Kalamazoo, Michigan,4,2 50&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Western City=Michigan State=Kalamazo OSU=Michigan OPP=4 _ERROR_=1 _N_=24&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 26 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;26 2/6/1998,Michigan State,Columbus , Ohio,4,2 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=ichigan City=State State=Columbus OSU=Ohio OPP=4 _ERROR_=1 _N_=25&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 27 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;27 2/7/1998,Alaska-Fairbanks,Columbus , Ohio,4,4 45&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=laska-Fa City=irbanks State=Columbus OSU=Ohio OPP=4 _ERROR_=1 _N_=26&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 28 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;28 2/13/1998,Notre Dame,South Bend,Indiana,5,3 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Notre Da City=me State=South Be OSU=Indiana OPP=5 _ERROR_=1 _N_=27&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 29 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;29 2/14/1998,Michigan State,East Lansing,Michigan,4,1 50&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Michigan City=State State=East Lan OSU=Michigan OPP=4 _ERROR_=1 _N_=28&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 30 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;30 2/26/1998,Miami,Columbus , Ohio,5,2 35&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Miami,Co City=lumbus State=Ohio OSU=5 OPP=2 _ERROR_=1 _N_=29&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 31 1-10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;31 3/13/1998,Lake Superior,Columbus , Ohio,2,1 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Lake Sup City=erior State=Columbus OSU=Ohio OPP=2 _ERROR_=1 _N_=30&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for date in line 32 1-10.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;32 3/14/1998,Lake Superior,Columbus , Ohio,6,0 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;date=. Team=Lake Sup City=erior State=Columbus OSU=Ohio OPP=6 _ERROR_=1 _N_=31&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: 36 records were read from the infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv".&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The minimum record length was 35.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The maximum record length was 56.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.HOCKEY has 36 observations and 6 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.06 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.02 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;68&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;69 proc print data = hockey; run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 36 observations read from the data set WORK.HOCKEY.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 1.56 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 1.50 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;70&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;71 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Thank you for your time and guiding&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 13:53:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374256#M89596</guid>
      <dc:creator>Koke</dc:creator>
      <dc:date>2017-07-09T13:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374259#M89599</link>
      <description>&lt;P&gt;You image looks like the result of loading the data into an Excel version of that is using a different convention for date format than the data. So the values with day of month &amp;lt;= 12 were converted into dates and the other values were left as strings. &amp;nbsp;Note if you want to insert an image into your post here use the "Insert/edit image" (looks like the moon over some mountains) rather than just attaching it as a file. &amp;nbsp;That way readers can see the image without downloading it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you need to use the proper delimiter on your INFILE statement. The default is a comma when you use the DSD option. &amp;nbsp;But you will need to look at your actual CSV file with a text editor to see whether someone has sent you a file using a different delimiter and just used the .csv extension for convenience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use the right INFORMAT for your date values. They look to be in MDY order. You should also attach a FORMAT to your date variable so that SAS will display the value in a human readable form. &amp;nbsp;I would recommend using YYMMDD10 to avoid the confusion between MDY and DMY order that seems to impacting you now. &amp;nbsp;&amp;nbsp;You should also define the lengths of your character variables, otherwise SAS will default to using $8 for the length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note if you want to include the informats in the INPUT statement when reading from a delimited file you should always use the colon modifier in front of the informat specification to prevent SAS from "eating" the delimiter when the value is shorter than the width used in the informat specification. &amp;nbsp;And add the TRUNCOVER option to the INFILE statement to properly handle lines that do not every column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data hockey;
  infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"
    firstobs=2 dlm="," dsd truncover
  ;
  input
    date :mmyydd10.
    team :$10.
    city :$20.
    state :$2.
    OSU :$10.
    OPP :$10.
  ;
  format date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Jul 2017 14:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374259#M89599</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-09T14:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374262#M89602</link>
      <description>&lt;P&gt;A few slight changes to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;'s suggested code will give you what you want:&lt;/P&gt;
&lt;PRE&gt;data hockey;
  infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"
    firstobs=2 dlm="," dsd truncover
  ;
  input
    date :mmddyy10.
    team :$20.
    city :$20.
    state :$15.
    OSU
    OPP
  ;
  format date mmddyy10.;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 14:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374262#M89602</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-09T14:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374265#M89604</link>
      <description>&lt;P&gt;According to the log the date, in some rows, is not in mmddyy10. format.&lt;/P&gt;
&lt;P&gt;On line 7 the date is:&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;11/1/1997&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;On line 19 the date is &lt;STRONG&gt;1/3/1998&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;that means that day/month don't include leading zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't find an informat to convert those to dates, therefore, new suggestion:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data hockey;
  infile "/folders/myshortcuts/SASUniversityEdition/module 3/hockey.csv"
           firstobs = 2 delimiter="," dsd;

  input datex  $  
          Team $ City $ State $ OSU $ OPP $ ;

  mm = input(scan(datex,1,'/'),best2.);
  dd = input(scan(datex,2&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;,'/'&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;),best2.); &lt;BR /&gt;  yy = input(scan(datex,3,'/'),best4.); &lt;BR /&gt;  date = mdy(mm,dd,yy); &lt;BR /&gt;  drop datex; &lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 14:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374265#M89604</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-09T14:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374268#M89605</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;: mmddyy10. informat doesn't require leading zeros. The errors, I'm fairly certain, came from not having using the : operator for the text fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 15:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374268#M89605</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-09T15:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374270#M89606</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;, thank you. The : informats are new to me and I'm still not used to use them.&lt;/P&gt;
&lt;P&gt;I have checked the :dmmddyy10. informat and found it works fine.&lt;/P&gt;
&lt;P&gt;Thanks, again.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2017 15:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374270#M89606</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-09T15:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: convert number and date in the same column ,and combine to date (one variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374300#M89616</link>
      <description>&lt;P&gt;The data getting read into the wrong columns is the result of using formatted input mode instead of list input mode when reading a delimited file. &amp;nbsp;If you want to list the informat in the INPUT statement then you need to add the : modifier to keep your INPUT statement as one that is only using list mode input. &amp;nbsp;Otherwise when the actual date uses fewer than 10 characters the delimiter will become part of the value read. This will both mess up the value and get SAS confused about where it should be on the line to read the next field.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input date :mmddyy10. Team :$8. City $ State $ OSU $ OPP $ ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I find if instead use a LENGTH statement to define your variables and an INFORMAT statement to tell SAS how to read the value then writing the INPUT statement is easier and these types or mistakes can be avoided. &amp;nbsp;If you define all of the variables in advance then you do not even need the $ on the input statement since SAS already knows the variables are character.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length date 8 Team $8 City $8 State $8 OSU $8 OPP $8 ;
informat date mmddyy10. ;
format date mmddyy10. ;
input date Team City State OSU OPP ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Jul 2017 18:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-number-and-date-in-the-same-column-and-combine-to-date/m-p/374300#M89616</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-09T18:08:05Z</dc:date>
    </item>
  </channel>
</rss>

