|
Like an Address out sort?
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx <javascript:;> [mailto:
midrange-l-bounces@xxxxxxxxxxxx <javascript:;>] On Behalf Of Booth Martin
Sent: Wednesday, September 25, 2013 1:34 PM
To: Midrange Systems Technical Discussion
Subject: Re: Sort input file by arbitrary position/length
Have you considered something like this:
Create a new work file defined with a key field of say, 150 columns and
then another field for the RRN of your main file. Then add a new process
which, when called, populates your new work file.
On 9/25/2013 3:09 PM, Zak Metz wrote:
Assuming there's an easy way to get the list of fields in the inputfile, I believe I can do this with 2 mapped fields:
thinking the offsets could change between the actual physical file and my
OPNQRYF FILE((METZ3410/PF2)) KEYFLD((*MAPFLD/ZIP)) +
MAPFLD((ONEBIGFLD 'pf2f1 *cat pf2f2 *cat +
pf2f3') (ZIP '%sst(onebigfld 133 5)')) +
OPNID(C1BMNAM) SEQONLY(*NO) OPNSCOPE(*JOB)
However, if any of the fields I'm concatenating are not strings, I'm
concatenated representation, so the user-provided offset of 133, length of
5 might have shifted. In fact, I don't think I can simply concatenate
numeric fields to a string.
input file, I don't see any way to sort it. If there were just a way to
Looks like I'm at a dead end. Unless I'm willing to make a copy of the
view the file as one long record regardless of its actual external
description, I could do it with OPNQRYF.
Jeff Young
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx <javascript:;>
[mailto:midrange-l-bounces@xxxxxxxxxxxx <javascript:;>] On Behalf Of
Sent: Wednesday, September 25, 2013 2:50 PMexisting file, PLUS a number (10 should be good) of 32 byte (or longer if
To: Midrange Systems Technical Discussion
Subject: Re: Sort input file by arbitrary position/length
Try this:
1. Create a permanent physical file with the same format as your
needed) fields that will be used for sorting.
2. Build the OPNQRYF command in a CL variable with the fixed parts as aconstant, along with the FORMAT keyword to refer to your new file and the
KEYFLD keyword sorting by the new fields in your format file. For the
MAPFLD keyword, specify the sort field name and the value as %sst() .
ie: OPNQRYF FILE(MYFILE) FORMAT(MYFILE_S) QRYSLT(....) KEYFLD(KEY1the result into a string variable that you will pass to QCMDEXC to execute.
KEY2
KEY3) MAPFLD(
Then build your MAPFLD expression as another variable and concatenate
Then, in your OVRDBF command, specify the TOFILE keyword as the FORMATfile with SHARE(*YES).
This should give you what you want.
________________________________
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx <javascript:;> To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx <javascript:;> Before posting,
please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx <javascript:;>
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx <javascript:;>
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.