John, I am not the OP, but I can imagine one very good reason -- Production control procedures.
If the file that the OP is trying to extract is a production file and the resulting file also has to feed another production program, then a new program has to pass through all of the system development lifecycle processes, which can be quite bureaucratic in a large organization. However, sort control cards for a production JCL sort job *may* (depending on the organization) more easily and quickly pass through such procedures, sometimes with much less process and paperwork. Besides that, sort is EVER so much more efficient at doing I/O (especially to or from non-VSAM files) than any user-written HLL program. Sort is often my first choice on that basis alone (assuming the selection and/or processing logic can be accommodated with existing sort control verbs). Just a couple of thoughts for your consideration. Peter > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On > Behalf Of John Gilmore > Sent: Monday, November 21, 2011 5:02 PM > To: IBM-MAIN@bama.ua.edu > Subject: Re: Simple record extraction from a sequential file > > You have a response that apparently meets your needs. > > Your question interests me for another reason. I asked two admittedly > very bright 15 year olds to write a parameterized--a value V, a field > of length L, and a one-origin offset O of its first byte--PL/I > procedure to do what you want to do. > > It took them 10 and 13 minutes, respectively, to come up with correct, > working procedures complete with bullet proofing and test cases. > > The use of the SORT to do this job seems to me to be much akin to > using a piledriver to set a ten-penny nail., and I should be > interested to know why you sought a canned solution to a problem of > this sort. > > John Gilmore, Ashland, MA 01721 - USA > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO > Search the archives at http://bama.ua.edu/archives/ibm-main.html This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html