> -----Original Message----- > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] > On Behalf Of Elardus Engelbrecht > Sent: Wednesday, October 22, 2014 3:52 PM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Re: DFSORT/ICETOOL pondering > > Thomas Berg wrote: > > >Sometimes I have a need to do a selective copy of a dataset where the > selection is both record sequence and record position/part dependent. > >And by that I mean the record part/position is varying depending on which > record it's about. > >An example (yes, it looks silly): > > Who ever gave you homework is silly... ;-D
...it's me... :) > >I want to copy position 31 to 40 of all records but from record 8 and 9 I > >want > to copy also (concatenate) position 71 to 80 and from record 6 to 8 I also > (concatenate in "front") want to copy position 1 to 3. > > Hmmm. Hard requirement if you want all of this in ONE pass. Could you be kind > to post an example of your input and output? An hypotethical example (monospace font recommended): Input: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 001aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb01ccccccccccccccccccccccccccccccdddddddd01 002aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb02ccccccccccccccccccccccccccccccdddddddd02 003aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb03ccccccccccccccccccccccccccccccdddddddd03 004aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb04ccccccccccccccccccccccccccccccdddddddd04 005aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb05ccccccccccccccccccccccccccccccdddddddd05 006aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb06ccccccccccccccccccccccccccccccdddddddd06 007aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb07ccccccccccccccccccccccccccccccdddddddd07 008aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb08ccccccccccccccccccccccccccccccdddddddd08 009aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb09ccccccccccccccccccccccccccccccdddddddd09 010aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbb10ccccccccccccccccccccccccccccccdddddddd10 Output: ----+----1----+----2----+----3 bbbbbbbb01 bbbbbbbb02 bbbbbbbb03 bbbbbbbb04 bbbbbbbb05 006bbbbbbbb06 007bbbbbbbb07 008bbbbbbbb08dddddddd08 bbbbbbbb09dddddddd09 bbbbbbbb10 > What about the rest of input? Should they stay the same during copy or left > out > of the output? The rest is discarded. > >I can see the use of the SUBSET (ICETOOL) for record selection but how do you > user DFSORT/ICETOOL to solve the combining record and varying position needs > ? > > What about SPLICE and JOIN? I haven't looked more closely at these. Thought they required a matching file etc. > >I now use a homegrown program for this but it's lacking efficiency to say the > least and I'm looking at DFSORTs efficiency and speed. > > How so? Could you post that program or some snippets? I believe I could do > that > with REXX. That program IS coded in REXX. It works but it's a problem with (very) large files. (This program is sort of a Swiss Army Knife with lot of other functions, this copy problem is a minor subfunction in it. I use it e g as a line command at ISPF 3.4 etc.) Best Regards, Thomas Berg ___________________________________________________________________ Thomas Berg Specialist zOS/RQM/IT Delivery Swedbank AB (Publ) ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN