From: Walter Murray on
What happens in COBOL if you reference the INTEGER-OF-DATE function and
specify an invalid date for the argument?

The 1985 COBOL standard says that anything can happen ("the result of such a
reference is undefined").

I would be interested to know the results for various compilers. The
question came up during a migration.

Thanks.

Walter



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
From: Chuck Stevens on
Good to see you participating, Walter!

Unisys MCP COBOL85 gives a zero result, the same as it would give for the
(out-of-bounds) date of 12/31/1600.

For an ISO/IEC 1989:2002-compliant compiler, the user can >>TURN EC-ALL
CHECKING ON, and in that instance, a bad argument value to INTEGER-OF-DATE
woud cause the EC-ARGUMENT-FUNCTION exception condition to be set to exist,
and if no actual handling (generic or specific to the exception) were
provided, the program would be discontinued.

Note that according to the ANSI X3.23-1985 glossary, "integer" values do not
include zero unless the rules for the particular construct so state, which
they don't for either INTEGER-OF-DATE or for DATE-OF-INTEGER.

-Chuck Stevens

"Walter Murray" <wmurray(a)midtown.net> wrote in message
news:4292ab55$1_2(a)spool9-west.superfeed.net...
> What happens in COBOL if you reference the INTEGER-OF-DATE function and
> specify an invalid date for the argument?
>
> The 1985 COBOL standard says that anything can happen ("the result of such
a
> reference is undefined").
>
> I would be interested to know the results for various compilers. The
> question came up during a migration.
>
> Thanks.
>
> Walter
>
>
>
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption
=----


From: William M. Klein on
Walter,
I haven't tried it recently, but I think that IBM mainframes give a run-time
error and terminate. I know that when you do "similar" things with their
callable services, you get something like the message at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/1.107

P.S. Usual "reminder" the Intrinsic Function module was OPTIONAL in the '89
(not '85) ANSI/ISO Standard (even at the high level) - but was REQUIRED by the
FIPS High-Level specification.

There was NO requirement in any of these as to what happened with invalid
arguments.

--
Bill Klein
wmklein <at> ix.netcom.com
"Walter Murray" <wmurray(a)midtown.net> wrote in message
news:4292ab55$1_2(a)spool9-west.superfeed.net...
> What happens in COBOL if you reference the INTEGER-OF-DATE function and
> specify an invalid date for the argument?
>
> The 1985 COBOL standard says that anything can happen ("the result of such a
> reference is undefined").
>
> I would be interested to know the results for various compilers. The
> question came up during a migration.
>
> Thanks.
>
> Walter
>
>
>
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
> News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
> Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption =----


From: William M. Klein on
I just found the correct run-time message. See:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/7.87
and
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/7.88


In "IBM-ese" there are a S-level messages and results in the programming
"ABENDing".

--
Bill Klein
wmklein <at> ix.netcom.com
"William M. Klein" <wmklein(a)nospam.netcom.com> wrote in message
news:omKke.493207$QY2.208777(a)fe01.news.easynews.com...
> Walter,
> I haven't tried it recently, but I think that IBM mainframes give a run-time
> error and terminate. I know that when you do "similar" things with their
> callable services, you get something like the message at:
>
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/1.107
>
> P.S. Usual "reminder" the Intrinsic Function module was OPTIONAL in the '89
> (not '85) ANSI/ISO Standard (even at the high level) - but was REQUIRED by the
> FIPS High-Level specification.
>
> There was NO requirement in any of these as to what happened with invalid
> arguments.
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "Walter Murray" <wmurray(a)midtown.net> wrote in message
> news:4292ab55$1_2(a)spool9-west.superfeed.net...
>> What happens in COBOL if you reference the INTEGER-OF-DATE function and
>> specify an invalid date for the argument?
>>
>> The 1985 COBOL standard says that anything can happen ("the result of such a
>> reference is undefined").
>>
>> I would be interested to know the results for various compilers. The
>> question came up during a migration.
>>
>> Thanks.
>>
>> Walter
>>
>>
>>
>> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
>> News==----
>> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
>> Newsgroups
>> ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
>
>


From: Chuck Stevens on
Note that Unisys MCP COBOL85 gives a zero response to an INTEGER-OF-DATE
call in which any part of the argument is incorrect -- for example, 20050532
and 20051324 will both return zero.

It's not clear from these references whether IBM COBOL rejects invalid dates
larger than 16010101 and smaller than 99991231 as arguments to this
function.

In the MCP COBOL85 implementation, comparison of FUNCTION INTEGER-OF-DATE
(FUNCTION DATE-OF-INTEGER (A-DATE)) against A-DATE will fail if A-DATE is
nonzero and not a valid date.

-Chuck Stevens

"William M. Klein" <wmklein(a)nospam.netcom.com> wrote in message
news:4pKke.165992$gX5.85376(a)fe04.news.easynews.com...
> I just found the correct run-time message. See:
>
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/7.87
> and
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/7.88
>
>
> In "IBM-ese" there are a S-level messages and results in the programming
> "ABENDing".
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "William M. Klein" <wmklein(a)nospam.netcom.com> wrote in message
> news:omKke.493207$QY2.208777(a)fe01.news.easynews.com...
> > Walter,
> > I haven't tried it recently, but I think that IBM mainframes give a
run-time
> > error and terminate. I know that when you do "similar" things with
their
> > callable services, you get something like the message at:
> >
> >
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ceea9150/1.107
> >
> > P.S. Usual "reminder" the Intrinsic Function module was OPTIONAL in the
'89
> > (not '85) ANSI/ISO Standard (even at the high level) - but was REQUIRED
by the
> > FIPS High-Level specification.
> >
> > There was NO requirement in any of these as to what happened with
invalid
> > arguments.
> >
> > --
> > Bill Klein
> > wmklein <at> ix.netcom.com
> > "Walter Murray" <wmurray(a)midtown.net> wrote in message
> > news:4292ab55$1_2(a)spool9-west.superfeed.net...
> >> What happens in COBOL if you reference the INTEGER-OF-DATE function and
> >> specify an invalid date for the argument?
> >>
> >> The 1985 COBOL standard says that anything can happen ("the result of
such a
> >> reference is undefined").
> >>
> >> I would be interested to know the results for various compilers. The
> >> question came up during a migration.
> >>
> >> Thanks.
> >>
> >> Walter
> >>
> >>
> >>
> >> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
> >> News==----
> >> http://www.newsfeeds.com The #1 Newsgroup Service in the World!
120,000+
> >> Newsgroups
> >> ----= East and West-Coast Server Farms - Total Privacy via Encryption
=----
> >
> >
>
>