Radoslaw Skorupka wrote:
> 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 ?
You can use a DFSORT job like the following to split the records
contiguously to 8 output data sets in one pass:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//OUT4 DD DSN=... output file4
//OUT5 DD DSN=... output file5
//OUT6 DD DSN=... output file6
//OUT7 DD DSN=... output file7
//OUT8 DD DSN=... output file8
//SYSIN DD *
OPTION COPY
OUTFIL SPLITBY=40000,
FNAMES=(OUT1,OUT2,OUT3,OUT4,OUT5,OUT6,OUT7,OUT8)
/*
OUT1 will have records 1-40000, OUT2 will have records 40001-80000, ...,
OUT8 will have records 280001-300000.
Frank Yaeger - DFSORT Team (IBM)
Specialties: ICETOOL, IFTHEN, OVERLAY, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
----------------------------------------------------------------------
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