Re: If you were inventing CoBOL...
From: Chuck Stevens (charles.stevens_at_unisys.com)
Date: 09/16/04
- Next message: sbelt_at_dpcsystems.com: "Re: Is a General File Maintenance Routine possible?"
- Previous message: William M. Klein: "Re: If you were inventing CoBOL..."
- In reply to: Robert Wagner: "Re: If you were inventing CoBOL..."
- Next in thread: Howard Brazee: "Re: If you were inventing CoBOL..."
- Reply: Howard Brazee: "Re: If you were inventing CoBOL..."
- Reply: Rick Smith: "Re: If you were inventing CoBOL..."
- Reply: Robert Wagner: "Re: If you were inventing CoBOL..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Sep 2004 09:50:08 -0700
"Robert Wagner" <robert@wagner.net.yourmammaharvests> wrote in message
news:d8vik09juqiqgm1hoci50idp18gkegopp4@4ax.com...
> It seems clear that GIVING was required in the '68 standard. The rule
> prior to '68 is less clear.
ANSI X3.23-1968 is also regularly referred to as "First Standard COBOL".
That should tell you something.
COBOL rules before 1968 were pretty much a gentlemen's agreement, with input
from users, among compiler vendors. There was no *rule* before '68, and
the *guidelines* that existed back then appear to me not to have included
DIVIDE ... BY without GIVING.
> We've seen other cases of changes missing from the substantive change
> list.
True enough, but the fact that it's not there in two conformant '68
implementation and one COBOL-60 implementation does not lead me to believe
it was a substantive change in '74, noted or otherwise.
> Agreed. I made a mental note to avoid DIVIDE BY and have not used it
> since.
That's a far cry from "GIVING wasn't required in the good old days."
> While we're on the topic .. it would nice of we could write DIVIDE A
> INTO B GIVING REMAINDER C. I often want just the remainder, don't care
> about the quotient. For example: divide 7 into
> integer-of-date(current-date) giving remainder day-of-week-today.
I think I'd have to argue that this should be reflected as
divide 7 into integer-of-date (current-date (1:8)) giving remainder
day-of-week-today.
I'm personally uncomfortable with the idea of passing those other 13
characters to the integer-of-date function, and wouldn't be surprised at a
fatal EC-ARGUMENT-FUNCTION exception were I to try it.
That being said, what the remainder looks like is dependent on the
relationship among the descriptions of the divisor, the dividend and the
quotient. In the general case your suggestion wouldn't produce meaningful
results.
There are other ways to skin a cat, and the ISO date proposal for the 2008
standard provides for
MOVE CURRENT-FORMATTED-DATE ("YYYYWwwD") (8:1) TO day-of-week-today.
which I think is a whole lot clearer way to accomplish what you wish here.
You can even write your own function to do this today, if it's important
enough to you.
Can you not accomplish DIVIDE REMAINDER without INTO or GIVING today with
the arithmetics and the various intrinsic functions?
-Chuck Stevens
- Next message: sbelt_at_dpcsystems.com: "Re: Is a General File Maintenance Routine possible?"
- Previous message: William M. Klein: "Re: If you were inventing CoBOL..."
- In reply to: Robert Wagner: "Re: If you were inventing CoBOL..."
- Next in thread: Howard Brazee: "Re: If you were inventing CoBOL..."
- Reply: Howard Brazee: "Re: If you were inventing CoBOL..."
- Reply: Rick Smith: "Re: If you were inventing CoBOL..."
- Reply: Robert Wagner: "Re: If you were inventing CoBOL..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|