<?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: log Error in format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14511#M2327</link>
    <description>Hello Robert,&lt;BR /&gt;
&lt;BR /&gt;
Many thanks for the reply. I get the error as:-&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Invalid data for enddate in line 235 14-22.&lt;BR /&gt;
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----&lt;BR /&gt;
235        398 17oct1997 02nov1997&lt;BR /&gt;
Projid=398 startdate=13804 enddate=. Duration=. _ERROR_=1 _N_=1&lt;BR /&gt;
NOTE: Invalid data for enddate in line 236 14-22.&lt;BR /&gt;
236        942 22jan1998 10mar1998&lt;BR /&gt;
Projid=942 startdate=13901 enddate=. Duration=. _ERROR_=1 _N_=2&lt;BR /&gt;
NOTE: Invalid data for enddate in line 237 14-22.&lt;BR /&gt;
237        167 15dec1999 15feb2000&lt;BR /&gt;
Projid=167 startdate=14593 enddate=. Duration=. _ERROR_=1 _N_=3&lt;BR /&gt;
NOTE: Invalid data for enddate in line 238 14-22.&lt;BR /&gt;
238        250 04jan2001 11jan2001&lt;BR /&gt;
Projid=250 startdate=14979 enddate=. Duration=. _ERROR_=1 _N_=4&lt;BR /&gt;
NOTE: Missing values were generated as a result of performing an operation on&lt;BR /&gt;
      missing values.&lt;BR /&gt;
      Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;
      4 at 233:17&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
kriti</description>
    <pubDate>Sun, 10 Oct 2010 09:45:40 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-10-10T09:45:40Z</dc:date>
    <item>
      <title>log Error in format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14509#M2325</link>
      <description>Kindly could you see the code below and suggest whts wrong in it:-&lt;BR /&gt;
&lt;BR /&gt;
data projects;&lt;BR /&gt;
options nodate pageno=1 linesize=80 pagesize=60;    &lt;BR /&gt;
   input Projid startdate date9. enddate date9.;&lt;BR /&gt;
   Duration=enddate-startdate;&lt;BR /&gt;
   datalines;&lt;BR /&gt;
398 17oct1997 02nov1997&lt;BR /&gt;
942 22jan1998 10mar1998&lt;BR /&gt;
167 15dec1999 15feb2000&lt;BR /&gt;
250 04jan2001 11jan2001&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=projects;&lt;BR /&gt;
   format startdate enddate date9.;&lt;BR /&gt;
      title 'Days Between Project Start and Project End';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
reagrds,&lt;BR /&gt;
Kriti</description>
      <pubDate>Sun, 10 Oct 2010 09:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14509#M2325</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-10T09:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: log Error in format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14510#M2326</link>
      <description>When referring to a "log Error" it would be most helpful to post the relevant log parts as well.&lt;BR /&gt;
(Just from a quick glance I can't see anything wrong with your code. Only thing I would change: move the options statement ahead of the data step).</description>
      <pubDate>Sun, 10 Oct 2010 09:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14510#M2326</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2010-10-10T09:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: log Error in format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14511#M2327</link>
      <description>Hello Robert,&lt;BR /&gt;
&lt;BR /&gt;
Many thanks for the reply. I get the error as:-&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Invalid data for enddate in line 235 14-22.&lt;BR /&gt;
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----&lt;BR /&gt;
235        398 17oct1997 02nov1997&lt;BR /&gt;
Projid=398 startdate=13804 enddate=. Duration=. _ERROR_=1 _N_=1&lt;BR /&gt;
NOTE: Invalid data for enddate in line 236 14-22.&lt;BR /&gt;
236        942 22jan1998 10mar1998&lt;BR /&gt;
Projid=942 startdate=13901 enddate=. Duration=. _ERROR_=1 _N_=2&lt;BR /&gt;
NOTE: Invalid data for enddate in line 237 14-22.&lt;BR /&gt;
237        167 15dec1999 15feb2000&lt;BR /&gt;
Projid=167 startdate=14593 enddate=. Duration=. _ERROR_=1 _N_=3&lt;BR /&gt;
NOTE: Invalid data for enddate in line 238 14-22.&lt;BR /&gt;
238        250 04jan2001 11jan2001&lt;BR /&gt;
Projid=250 startdate=14979 enddate=. Duration=. _ERROR_=1 _N_=4&lt;BR /&gt;
NOTE: Missing values were generated as a result of performing an operation on&lt;BR /&gt;
      missing values.&lt;BR /&gt;
      Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;
      4 at 233:17&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
kriti</description>
      <pubDate>Sun, 10 Oct 2010 09:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14511#M2327</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-10T09:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: log Error in format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14512#M2328</link>
      <description>O.k., I guess I see. You have a mixture of input styles in your input statement.&lt;BR /&gt;
&lt;BR /&gt;
The first part ("input projid") is referred to as "list input", a technique where you just name the variables without assigning an explicit informat.&lt;BR /&gt;
The other part "input ... startdate date9. enddate date9." is referred to as "formatted input". As SAS processes the input statement it moves it's internal column pointer ahead. With formatted input the column pointer points to the column right after the (in)formatted value. In your case that means "enddate" begins with the blank separating your date values. This makes enddate having an invalid value.&lt;BR /&gt;
Possible solutions:&lt;BR /&gt;
a) manually move the column pointer by one column&lt;BR /&gt;
[pre]&lt;BR /&gt;
input projid startdate date9. +1 enddate date9. ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
b) search for and read the sections on the "colon modifier" in the input statement documentation&lt;BR /&gt;
[pre]&lt;BR /&gt;
input projid startdate : date9. enddate : date9. ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Quote from 9.1.3 documentation: &lt;I&gt;For a numeric variable, this format modifier reads the value from the next non-blank column until the pointer reaches the next blank column or the end of the data line, whichever comes first. &lt;/I&gt;</description>
      <pubDate>Sun, 10 Oct 2010 10:42:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/log-Error-in-format/m-p/14512#M2328</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2010-10-10T10:42:15Z</dc:date>
    </item>
  </channel>
</rss>

