there is was to split a file into more than 1 output files each having similar number of records.
ur req is
input has - 100 records right?
and u want to split it into 3 output files?
U can uses ICETOOL which will identify number of records in input file and spilt it accordingly into 3 output files
1st outut file - will contain 1st 33 records
2nd - will contain 2nd 33 records (i.e from 34th to 66th)
3rd will contain last 34 records.
since the tool itself will generate the number of input record counts...u o not have to worry any more to manually go and identify the number of records...
if i have got ur requirement correct..please let me know???
yes you can get the record count in separate file
please find the details below
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=.....input file/
/T1 DD DSN=...total count in input file give some datasets name here
// UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,CATLG,DELETE),
// DCB=(LRECL=500,RECFM=FB,BLKSIZE=0)
//C1 DD DSN=...total count in each of the spillted outputs
// UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,CATLG,DELETE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//CTL3CNTL DD *
OUTFIL FNAMES=(OUT01,OUT02,OUT03),
( .. since we are splitting into three we will be giving till out03... if say we have to split into 7 files we have to give till out07)
// DD DSN=*.C1,VOL=REF=*.C1,DISP=(OLD,PASS)
//OUT01 DD DSN=....split output1
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(25,25),RLSE),
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=0)
//OUT02 DD DSN=....split output2
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(25,25),RLSE),
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=0)
//OUT03 DD DSN=....split output3
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(25,25),RLSE),
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=0)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(C1) USING(CTL2)
COPY FROM(IN) USING(CTL3)
/*
//CTL1CNTL DD * .... this will get the count in input file OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=11))
/*
//CTL2CNTL DD * ..divides the count generated in CTL1 by 3 as we are splitting into 3 output file
OUTREC BUILD=(2X,C'SPLIT1R=',
1,11,ZD,DIV,+03,TO=ZD,LENGTH=11,80:X)
/*