<?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: b8601dj informat handling of invalid values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592388#M169838</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;. I’m on 9.4M4, maybe it’s fixed in M5. &lt;BR /&gt;&lt;BR /&gt;What do you get from:&lt;/P&gt;
&lt;PRE&gt;b8601dj =input('19600101250000' ,b8601dj14.) ;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Does it return null or does it return 2 Jan 1:00am? If it returns null, does it throw the invalid note?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you get from:&lt;/P&gt;
&lt;PRE&gt;b8601dj=input('1960010199QQQQ',b8601dj14.) ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume it returns null. &amp;nbsp;Does it throw the invalid note?&lt;/P&gt;</description>
    <pubDate>Sat, 28 Sep 2019 12:59:48 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2019-09-28T12:59:48Z</dc:date>
    <item>
      <title>b8601dj informat handling of invalid values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592181#M169762</link>
      <description>&lt;P&gt;Had a few surprises using the&amp;nbsp;b8601dj informat to read date-time values YYYYMMDDHHMMSS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the time portion is 250000 it returns a null value, and does NOT throw an error.&amp;nbsp; This is different than the datetime informat, which would treat it as 0100 on the next day:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    data _null_ ;
2      datetime=input('01JAN1960:25:00:00',datetime18.) ;
3      b8601dj =input('19600101250000'    ,b8601dj14.) ;
4
5      put datetime= b8601dj= ;
6      format  datetime b8601dj datetime19. ;
7    run ;

datetime=02JAN1960:01:00:00 b8601dj=.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;I'm okay with 250000 being treated as invalid, but I would expect an error in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also surprising, even letters in the value will not cause an error message, as long as the first ten characters are numeric:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;8    data _null_ ;
9      b8601dj=input('1960010199QQQQ',b8601dj14.) ;
10     put b8601dj= ;
11   run ;

b8601dj=.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I add one more letter, it will finally throw an error:&lt;/P&gt;
&lt;PRE&gt;12   data _null_ ;
13     b8601dj=input('196001019QQQQQ',b8601dj14.) ;
14     put b8601dj= ;
15   run ;

ERROR: Invalid argument to function INPUT at line 13 column 11.
b8601dj=. _ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;Is this surprising behavior?&amp;nbsp; Seems like it's worth documenting.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 14:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592181#M169762</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-09-27T14:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: b8601dj informat handling of invalid values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592380#M169836</link>
      <description>&lt;P&gt;It does write a Note an it sets the automatic variable _ERROR_ to 1 in my SAS version (SYSVLONG 9.04.01M5P091317) so you could add a check on&amp;nbsp; _ERROR_ or the resulting variable being missing.&lt;/P&gt;
&lt;PRE&gt;28         data _null_ ;
29           b8601dj=input('196001019QQQQ',b8601dj14.) ;
30           put b8601dj= ;
31         run ;

NOTE: Invalid argument to function INPUT at line 29 column 11.
b8601dj=.
b8601dj=. _ERROR_=1 _N_=1
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to 
      missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 29:11  &lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Sep 2019 10:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592380#M169836</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-28T10:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: b8601dj informat handling of invalid values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592388#M169838</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;. I’m on 9.4M4, maybe it’s fixed in M5. &lt;BR /&gt;&lt;BR /&gt;What do you get from:&lt;/P&gt;
&lt;PRE&gt;b8601dj =input('19600101250000' ,b8601dj14.) ;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Does it return null or does it return 2 Jan 1:00am? If it returns null, does it throw the invalid note?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you get from:&lt;/P&gt;
&lt;PRE&gt;b8601dj=input('1960010199QQQQ',b8601dj14.) ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume it returns null. &amp;nbsp;Does it throw the invalid note?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2019 12:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592388#M169838</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-09-28T12:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: b8601dj informat handling of invalid values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592398#M169843</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can replicate both your examples and Patrick's (which is different) with the same 9.4M5 release as his. To get your "&lt;EM&gt;ERROR&lt;/EM&gt;: Invalid argument ..." message (and the subsequent error-like behavior) I need to use the (undocumented)&amp;nbsp;&lt;FONT face="courier new,courier"&gt;dsoptions=note2err&lt;/FONT&gt; system option, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever the result was a missing value which was not accompanied by an "Invalid argument" message the result did not change when I set&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options invaliddata='X';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Sep 2019 15:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592398#M169843</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-09-28T15:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: b8601dj informat handling of invalid values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592404#M169844</link>
      <description>Thanks @FreelanceReinhard. That’s enough confirmation for me to consider this a bug. I’ll send it in. &lt;BR /&gt;&lt;BR /&gt;You’re right, I have Note2Err turned on, I always forget that. &lt;BR /&gt;&lt;BR /&gt;I didn’t know about the invaliddata option. So thanks for mentioning that as well!</description>
      <pubDate>Sat, 28 Sep 2019 15:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/592404#M169844</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-09-28T15:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: b8601dj informat handling of invalid values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/593037#M170126</link>
      <description>&lt;P&gt;I sent it in to tech support, and they confirmed it's a bug that b8601dj informat is not throwing the INVALID DATA note as it should. They said they will file a defect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks all.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 14:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/b8601dj-informat-handling-of-invalid-values/m-p/593037#M170126</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-10-01T14:02:40Z</dc:date>
    </item>
  </channel>
</rss>

