Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DATE() Consistency

14 views
Skip to first unread message

Paul Gilmartin

unread,
Aug 22, 2021, 10:11:48 PM8/22/21
to
The TSO/E Rexx reference says:

DATE
...
Note:
1. The first call to DATE or TIME in one clause causes a time
stamp to be made that is then used for all calls to these
functions in that clause. Therefore, multiple calls to any
of the DATE or TIME functions or both in a single expression
or clause are guaranteed to be consistent with each other.

This might rrequire that:
say date( , 17760704, S ) date()
display:
4 Jul 1776 4 Jul 1776

What does ANSI say? Does the note requirre a clarification
for the case where there is a second argument to date()?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Phil Smith III

unread,
Aug 23, 2021, 11:52:34 AM8/23/21
to
Gil wrote, in part:
>This might rrequire that:
> say date( , 17760704, S ) date()
>display:
> 4 Jul 1776 4 Jul 1776

Unless you're just noting that the wording could perhaps be clarified, you know the answer is "Of course not". The point is that an STCK or equivalent is performed by the first DATE function in a statement, so if the clock rolls during execution of that statement, the times aren't inconsistent. E.g., if the first DATE in the statement is executed at 23:59:59.99999999 and the rest of the statement takes enough time, it might be 00:00:00.x before the last one is executed. DATE(), DATE('D'), et al. will all return the same date.

I'd suggest that the wording is already clear enough for rock & roll.

...phsiii

Paul Gilmartin

unread,
Aug 23, 2021, 12:25:41 PM8/23/21
to
> On Aug 23, 2021, at 09:52:19, Phil Smith III <li...@AKPHS.COM> wrote:
>
> Gil wrote, in part:
>> This might rrequire that:
>> say date( , 17760704, S ) date()
>> display:
>> 4 Jul 1776 4 Jul 1776
>
> Unless you're just noting that the wording could perhaps be clarified,
>
Exactly. And using the word "consistent" suggests that the second date()
should return the same value as the first.

> you know the answer is "Of course not". The point is that an STCK or equivalent is performed by the first DATE function in a statement,
>
Itt doesn't say that. It merely says "a timestamp" which could equally
mean the clock value used to generate the result of the first call.

> so if the clock rolls during execution of that statement, the times aren't inconsistent. E.g., if the first DATE in the statement is executed at 23:59:59.99999999 and the rest of the statement takes enough time, it might be 00:00:00.x before the last one is executed. DATE(), DATE('D'), et al. will all return the same date.
>
It's an admirable design. IBM employees have conceded, OTOH, that system
symbols accessible in JCL are subject to the hazard you describe. That
should be fixed. But it's hard to supply a test case.

> I'd suggest that the wording is already clear enough for rock & roll.
>
Documentation shouldn't require the user to resort to guesswork, even
when the answer is almost certain.

The scope of the timestamp is well-chosen. It's not affected by a call
to a function which calls time()

-- gil

Phil Smith III

unread,
Aug 24, 2021, 10:15:56 AM8/24/21
to
Gil wrote, in part:
>Itt doesn't say that. It merely says "a timestamp" which could equally
>mean the clock value used to generate the result of the first call.

>Documentation shouldn't require the user to resort to guesswork, even when the >answer is almost certain.

I still think you're pushing it. POLA would not suggest interpreting it as you suggest folks will.

Documentation can always be improved, but as no less than Eric D Rossman edro...@us.ibm.com wrote recently, on IBM-MAIN:
>z/OS internals are notoriously under-commented and under-understood

There are much bigger fish to fry...
0 new messages