atchuta konduri
New User
Joined: 25 Oct 2007 Posts: 16 Location: mumbai
|
|
|
|
Hi,
The below is the jcl to split a file in to multiple files.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=_
//DFSMSG DD SYSOUT=_
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//C1 DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//CTL3CNTL DD _
OUTFIL FNAMES=(OUT_1,OUT_2,...,OUTnn), <--- code OUT_1-OUTnn
// DD DSN=_.C1,VOL=REF=_.C1,DISP=(OLD,PASS)
//OUT_1 DD DSN=... output file_1
//OUT_2 DD DSN=... output file_2
...
//OUTnn DD DSN=... output filenn <--- code OUT_1-OUTnn
//TOOLIN DD _
* Get the record count.
COPY FROM(IN) USING(CTL1)
* Generate:
* SPLIT1R=x where x = count/nn.
* nn is the number of output files.
COPY FROM(T1) TO(C1) USING(CTL2)
* Use SPLIT1R=x to split records contiguously among
* the nn output files.
COPY FROM(IN) USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=8))
/*
//CTL2CNTL DD *
OUTREC BUILD=(2X,C'SPLIT1R=',
1,8,ZD,DIV,+nn, <--- set to nn
TO=ZD,LENGTH=8,80:X)
/*
|
Here 'n' is the number of output files. Could any one please explain me the CTL1 and CTL2 control cards?
Thanks in advance.
Regards,
Atchuta |
|