× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I follow my self-defined "Rule of the 7": write it so even the 7th
programmer (who probably has no idea what they're doing) can understand the
code. Just because you can write a file maintenance program in a single
REGEX doesn't mean you should.

When you write complicated code, some well-meaning coder is going to try to
simplify it, possibly to debug it or possibly as a refactoring exercise.
IMO, a mark of good code is when your customers' programmers don't call and
ask for an explanation.

--reeve

On Tue, Aug 1, 2023 at 3:10 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

"So why walk when you can ride?"

Because I always write for maintainability. And I may not be around to
maintain it.


Jon P.

On Aug 1, 2023, at 6:00 PM, James H. H. Lampert via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

On 8/1/23 2:10 PM, Justin Taylor wrote:
Sounds like you're doing RPG RLA and want two File specs using the same
PF. Check out the EXTFILE File spec keyword.

It worked. Thanks. I didn't think it would be this simple, but it almost
is. "Almost" because it also needs an EXTDESC and a RENAME, i.e. (note that
spaces are squeezed out for email purposes):

FFOOBAR IP E DISK EXTDESC('FOO/FOOBAR')
F EXTFILE(*EXTDESC)
F RECNO(RRN)
FBOZBAR UF E DISK EXTDESC('FOO/FOOBAR')
F EXTFILE(*EXTDESC)
F RENAME(FOOREC:BOZREC)

(I'm even using an EXTDESC and EXTFILE on the primary, for absolute
LIBL-independence, and there's also a RECNO clause on the primary, because
the PF is unkeyed, and there's no key that's especially useful.)

And Jon, my attitude about riding The Cycle is that you should use any
language feature that you find useful, especially if it's idiomatic and/or
unique to the language. And there's probably nothing in RPG that's more
idiomatic or unique to the language than The Cycle. So why walk when you
can ride?

That's not to say that I've ever found secondary files to be even
remotely useful enough to be worth figuring out how to use them.

--
JHHL

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.