|
From: Michael Rosinger List, This is an iSeries newbie question so please bare with me. We are getting started on the project of migrating applications (all batch) from VSE (mainframe) to iSeries. I was "told" by someone that is a long-time AS/400 person that "there is no system sort on the iSeries". I find that very hard to believe. There must be some system provided sorting mechanism. I see that ILE/COBOL fully supports the SORT verb so that must be interfacing with a system-provided utility.
Michael already told you about FMTDTA, which is the iSeries version of SORT. It uses the same external sort specifications that I've used for 30 years, which I think are compatible with the mainframe. However, this is another area where you might want to consider taking advantage of certain iSeries features. In this case, you might want to create a logical file over the physical file. One of the options you have when creating a logical file is to set it up as MAINT(*DELAY), which means that the index is not kept up to date with every record addition so there's no additional overhead to programs that maintain the file, but when a program opens the logical file (which should only be the program that actually uses that logical), the index is rebuilt. In effect, the data is automatically sorted when you need it. Why do this? Because if you ever need to run the same process twice in a row, for example, then the second run wouldn't need to rebuild the access path; it would already by in place. And it seems to me that creating an access path in general is a lot faster than physically resequencing the data in a file. I don't want to say you'd always run faster; I'm not certain that rebuilding the access path for just a few new records is any faster than rebuilding it for the whole file; someone with more knowledge would have to say. And using an index to access records from a file is not the same as reading records sequentially in blocks. If you sort a large file once and run many reports over that file, FMTDTA may still be the way to go. But recognize that you have options. (Another option is OPNQRYF, which we can leave for another day <grin>.) Joe
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.