|
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Stone, Joel
Sent: Wednesday, September 25, 2013 9:41 AM
To: Midrange Systems Technical Discussion
Subject: RE: Sort input file by arbitrary position/length
No I don't think that is accurate (but I have been wrong before :)
Your stmt is accurate ONLY if the file is described in the COBOL
source as "ORGANIZATION IS INDEXED" and "RECORD KEY IS ..."
The RPG equivalent of "K" in the right spot for a file spec.
But his COBOL pgm has the file defined WITHOUT a key, so I am pretty
sure it will read it in the arrival sequence REGARDLESS of any keys or overrides.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Wednesday, September 25, 2013 9:34 AM
To: Midrange Systems Technical Discussion
Subject: Re: Sort input file by arbitrary position/length
Joel,
By using the OVRDBF command with SHARE(*YES), the COBOL program will
read the file using the Access Path created by the OPNQRYF.
On Wed, Sep 25, 2013 at 10:24 AM, Stone, Joel <Joel.Stone@xxxxxxxxxx>
wrote:
Have you actually tried this? I don't think that this will work asCOBOL
you are proposing.
When you run OPNQRYF, if creates the equivalent of a temp LF. When
reads this temp LF, it will read it as a PF (assuming no changes tophysical
the COBOL pgm to access C1BMNAM by key).
You would have to do CPYFRMQRYF after the OPNQRYF to order the
data - then the COBOL pgm would read in the sequence that you desire.
If the requirement is to NOT touch the COBOL pgm, then the physical
data must be re-ordered. I would expect FMTDTA to be faster than
OPNQRYF/CPYFRMQRYF or any other method.
But, it is so simple to change the COBOL to read an indexed file.
Maybe there are other constraints which require no changes to the COBOL.
Another option is SQL to re-order the data.
I don't see how OPNQRYF or LF or any kind of index will get you there.
As an Amazon Associate we earn from qualifying purchases.
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.