|
Like I said. I haven't been too observant with this thread. If this is a one time deal I go along with your method. If you are wanting to sort this file repetitively in a production environment I don't. I'd go with either rebuilding a user index or a dynamic SQL program. -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta Sent: Thursday, November 18, 2004 1:45 PM To: 'Midrange Systems Technical Discussion' Subject: RE: Reordering a file I was not trying to get the various ways to order records from a file in an arbitrary sequence. There are many ways, and in fact nobody selected one of my all-time favorites, OPNQRYF. The point was that I wanted to update the file with a sequence number, and I was simply asking for the easiest way to do that. It's amazing how many people insist on answering the question I specifically did NOT ask <grin>. Thanks, though, folks! It's actually a pretty cool discussion. Unfortunately it doesn't answer my question. The question is more simply stated this way: Given any file with a sequence number field, what is the simplest method to update the sequence number field to number the records sequentially based on an arbitrary view for which there is no logical. So far, my way is the fewest steps: use STRSQL to sort the records into a temp file, then copy the temp file to the original. Paul suggested FMTDTA, but as far as I know that requires creating another source member with the sort criteria. Not impossible, but it's an additional step. Same with creating a logical view and using that to reorganize the file: one extra step. The only other suggestion so far that fits the stated business requirement is to add a constraint and then use that to reorganize the file. The only downside is that you can't add a primary key constraint to a keyed physical, and this file happens to be a keyed physical (one more reason not to have keyed physicals, I guess!). Joe > From: Gary Monnier > > I have to admit I haven't been too observant with this thread so forgive > me if I'm asking a silly question. Why not use a user index rather than > a file? -- 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.
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.