The OUTFIL method not only does it in one step, but also in one pass of the input file. Another variant is the SPLIT option of OUTFIL which divides the file evenly across the specified number of output files: OUTFIL FNAMES=(FILE1,FILE2,FILE3,FILE4),SPLIT In your case, that only works if n goes evenly into the input file size. See http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst01.html (watch for folding) "Smart DFSORT Tricks" for more information.
Bill On Wed, 19 Apr 2006 10:06:00 +0200, Robert Bardos <[EMAIL PROTECTED]> wrote: >Radoslaw, > >have a look at the following link > ><http://www-03.ibm.com/servers/storage/support/software/sort/mvs/b >eyond_sorting/online/srtmboft.html#org> > >where it says: > >OUTFIL: ranges > >The OUTFIL operands STARTREC and ENDREC can be used to select a >range of records to be included in each output data set. STARTREC >starts processing at a specific OUTFIL input record while ENDREC >ends processing at a specific OUTFIL input record. > >Here's an example of OUTFIL ranges: > > OPTION COPY > OUTFIL FNAMES=FRONT,ENDREC=500 > OUTFIL FNAMES=MIDDLE,STARTREC=501,ENDREC=2205 > OUTFIL FNAMES=BACK,STARTREC=2206 > >Input records 1-500 are written to the FRONT data set. Input >records 501-2205 are written to the MIDDLE data set. The remaining >input records are written to the BACK data set. > > >HTH > >Robert Bardos >Ansys AG, Zurich, Switzerland > > >-----Ursprungliche Nachricht----- >Von: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] >Auftrag von R.S. >Gesendet: Mittwoch, 19. April 2006 09:51 >An: [email protected] >Betreff: DFSORT and dataset split > > >The task is to split large dataset (i.e. 300000 records) into >smaller >parts of n records each. n is constant value, let's say 40000. > >It can be done in several using COPY with SKIPREC x*n STOPAFT >(x+1)*n, >however this method requires several DFSORT steps. >Can it be done in one step ? > >-- >Radoslaw Skorupka >Lodz, Poland > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

