as I mentioned I will have 2 segments of each input file(BS/ED/BX) but the driver file L1 will be a single file and will ave data from all.
So do you mean we have to write two sets of Join statement one for the combination of each segment?
I still have problems to imagine what all the files would look like after a join, but because you need different contents for BS / ED or BX I think to join all your input files with each other would help a lot to do this. Because you can only join 2 files in one step there will be more than one JOIN-Steps... With DFSORT and ICETOOL you can sort from VSAM-Files into normal fixed blocked files without any problems, that was what I did in my example.
Why don't we begin to join the input-files to look at the result. Because you know your files best you then can decide if with the INREC-Commands you can extract all information you need. To make it simpler I will ignore the filler positions and work with symnames, so you can change them afterwars to match your needs.
When you speak of ED1 and ED2 or BX1 and BX2 can we append these files to each other, or do we need to join them? For example, what is the relationship between ED1 and ED2? Perhaps some code snippets can help, so you can choose:
So what I mean, do we join them:
//JOIN1 EXEC PGM=SORT
//SYMNAMES DD *
ED1KEY,1,19
ED2KEY,1,19
//SYSOUT DD SYSOUT=*
//ED1 DD DSN=USERID.VSAM.IN1,DISP=SHR
//ED2 DD DSN=USERID.VSAM.IN2,DISP=SHR
//SORTOUT DD DSN=USERID.VSAM.EDJOIN,DISP=OLD
//SYSIN DD *
OPTION COPY
JOINKEYS F1=ED1,FIELDS=(ED1KEY,A)
JOINKEYS F2=ED2,FIELDS=(ED2KEY,A)
/*
Or do we append them to each other and join them with the first other set of appended input files?
//JOIN1 EXEC PGM=SORT
//SYMNAMES DD *
ED12KEY,1,19
BX12KEY,21,19
//SYSOUT DD SYSOUT=*
//ED12 DD DSN=USERID.VSAM.IN1,DISP=SHR
DD DSN=USERID.VSAM.IN2,DISP=SHR
//BX12 DD DSN=USERID.VSAM.IN3,DISP=SHR
DD DSN=USERID.VSAM.IN4,DISP=SHR
//SORTOUT DD DSN=USERID.VSAM.EDBXJOIN,DISP=OLD
//SYSIN DD *
OPTION COPY
JOINKEYS F1=ED1,FIELDS=(ED12KEY,A)
JOINKEYS F2=ED2,FIELDS=(BX12KEY,A)
/*