Input file is
BEGIN CURRENT
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
END
BEGIN SUPPORT
SAMPLEFILSUPPORT2000-08-06
SAMPLEFILSUPPORT2000-08-06
END
BEGIN MANAGER
SAMPLEFILMANAGER2000-08-06
SAMPLEFILMANAGER2000-08-06
SAMPLEFILMANAGER2000-08-06
END
BEGIN PRODUCT
SAMPLEFILPRODUCT2000-08-06
SAMPLEFILPRODUCT2000-08-06
SAMPLEFILPRODUCT2000-08-06
SAMPLEFILPRODUCT2000-08-06
END
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
END
BEGIN SUPPORT
SAMPLEFILSUPPORT2000-08-06
SAMPLEFILSUPPORT2000-08-06
END
BEGIN MANAGER
SAMPLEFILMANAGER2000-08-06
SAMPLEFILMANAGER2000-08-06
SAMPLEFILMANAGER2000-08-06
END
BEGIN PRODUCT
SAMPLEFILPRODUCT2000-08-06
SAMPLEFILPRODUCT2000-08-06
SAMPLEFILPRODUCT2000-08-06
SAMPLEFILPRODUCT2000-08-06
END
My Jcl
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FB=256 input GDG,
// DISP=SHR
//OUT1 DD DSN=EOUT.V001,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(15,15),RLSE)
//OUT2 DD DSN=EOUT.V002,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(15,15),RLSE)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'BEGIN'),
PUSH=(257:ID=1))
OUTFIL FNAMES=OUT1,INCLUDE=(257,1,ZD,EQ,1),BUILD=(1,256)
OUTFIL FNAMES=OUT2,INCLUDE=(257,1,ZD,EQ,2),BUILD=(1,256)
/*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FB=256 input GDG,
// DISP=SHR
//OUT1 DD DSN=EOUT.V001,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(15,15),RLSE)
//OUT2 DD DSN=EOUT.V002,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(15,15),RLSE)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'BEGIN'),
PUSH=(257:ID=1))
OUTFIL FNAMES=OUT1,INCLUDE=(257,1,ZD,EQ,1),BUILD=(1,256)
OUTFIL FNAMES=OUT2,INCLUDE=(257,1,ZD,EQ,2),BUILD=(1,256)
/*
The produced output
First outdataset is
BEGIN CURRENT
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
END
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
SAMPLEFILCURRENT2000-08-06
END
second outdataset
BEGIN SUPPORT
SAMPLEFILSUPPORT2000-08-06
SAMPLEFILSUPPORT2000-08-06
END
SAMPLEFILSUPPORT2000-08-06
SAMPLEFILSUPPORT2000-08-06
END
The input file has set of records with header and trailer,.Header is BEGIN,Trailer is END
Every time the set of records may vary.So we cant give correct number of the OUTFIL parameter.
Is it possible to create a outdataset and OUTFIL dynamically according to the records split
For this example,the above input file has 4 set of records,so i need 4 outdatasets with the particular set of records.
but the SORT card has only 2 OUTFIL and Outdatasets.
How to generate the outdataset dynamically according to the set of records.
Thanks;