There's no good reason to sort a file in place on IBMi. Those "records" aren't going to be "next" to each other on any level of the abstraction that is single level storage. They'll only wind up "next" to each other on the reassembly of abstraction that is DSPPFM. The "records" are going to go in memory pages managed by the database. Those pages are not going to be next to each other in memory and it doesn't matter. The pages are going to be spread across disks and disk arms. To be accessed in order most efficiently, records that are "next" to each other in your ordering are going to actually be on different disks.
The efficient way to access a database table in order is to build an index. Let the database use the most efficient index to achieve the ordering you wish to use.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Lance Gillespie
Sent: Wednesday, January 23, 2013 10:17 AM
To: 'Midrange Systems Technical Discussion'
Subject: RE: how to sort a file in place?
If the file is keyed the way you want it sorted, or if there is a logical the way you want it sorted, there is always RGZPFM.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Stone, Joel
Sent: Wednesday, January 23, 2013 7:23 AM
To: 'Midrange Systems Technical Discussion'
Subject: how to sort a file in place?
I would like to sort WORKFILE1 in place, preferably using SQL.
Is this possible?
Or must I create another table with SQL CREATE and then CPYF it back to the original file.
Thanks!
______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs Skyscan service.
For more information please visit
http://www.symanteccloud.com ______________________________________________________________________
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx 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 To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx 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.