On Tue, Mar 3, 2020 at 3:37 PM Brian Parkins <goodprophet.bp@xxxxxxxxx> wrote:

Just for the archive, *START and *END were introduced at V4R4. (Are you
really working on an OS version before that ?!)

I distinctly remember having an issue with *START and *END. I believe
I was on V5R2 at the time. There was some situation where I thought
they should work, but they didn't.

Looking at a relatively modern manual (7.3), it says that these
special values can only be used when you specify the file name,
meaning they don't work if you specify the format name. This is
probably what my beef with it was. The standard practice at our shop
was (and is) to use the format, so I couldn't use *START and *END.

Worse yet, the manual was not clear about this. Where the 7.3 manual says this:

If you specify either *START or *END for search-arg, note the following:
* The name of the file must be specified as the name operand.

the V5R2 manual says this:

If you specify either *START or *END for search-arg, note the following:
* The name operand must be specified.

I spent a lot of time yelling profanities at the V5R2 compiler and
manual, because of course I *was* specifying the name operand. Even
the 7.3 wording feels like "what's the least we can get away with?".
In other contexts, most notably READ and READP, you can use either the
file or format name, and so I think it *should* read

* The name of the file must be specified as the name operand. It
will not work with the record format name.

or

* The name of the file (not the record format) must be specified as
the name operand.

And I get that this is the *reference*, which is going to be lawyerly
and stark, leaving it up to the reader to make inferences. But they
did bother to give warnings that you have to be careful with *HIVAL
and *LOVAL, and to remind the reader that SETLL doesn't cause a record
to be read, so it can be a better performing option than CHAIN if you
just want to test for existence. These are things that the reader
should be just as able to figure out on their own. I think this
conspicuous difference between file and format name for *START/*END
could have and should have been presented more explicitly.

I still don't know why they couldn't be made to work with format. It's
very hard to imagine that there is any technical challenge whatsoever.
It's just a very mysterious hole in functionality.

But anyway, I think it is completely reasonable that a large
percentage of RPG programmers haven't internalized *START and *END
because they just don't provide enough of a benefit to be worth the
cost of switching to using file names, if you're already using format
names.

If someone else wants to file an RFE, be my guest. I don't personally
think it's worth the bother. Especially since I feel that IBM had
their chance to fix this deficiency in the compiler, but they decided
to make the docs accurately reflect the behavior instead. Clearly they
are aware of this quirk, and they don't feel it's a wart.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.