SORT JCL with INCLUDE

Hi,

I have a VB file

Organization  . . . : PS   Record format . . . : VB   Record length . . . : 32566

Block size  . . . . : 32570

The data length would not be consistent for each record and the maximum length of the record would be a maximum of 200 characters

Find below the sample doc

CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXæEffective Dates%19.                                                      CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/KB-CEB/ABCDEFG%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IC/IBSTEFFECTIVEDATES%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IC/IBSTEFFECTIVEDATES%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IC2/I.B.A. Effective Dates%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IC3/IBSTEFFECTIVEDATES%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IT/Effective Dates%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-2/ %19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-3/Effective Dates%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-5/IW;0001;247220;0;0;0;0;0;0;1%19 CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-6/001468198%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-7/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000; CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-8/05044101%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-9/IB ST Effective Dates%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/CSED-11//001468198;0001;00001;000000%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/WING-AN/IBSTEFFECTIVEDATES%19 CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/WING-AN2/IBSTEFFECTIVEDATES%19. CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/WING-AN3/IBSTEFFECTIVEDATES%19.

CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/FIRST-PAGE/%19.

I want to have the information after COD-IC2 & COD-IT listed in a separate file horizontally

CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IC2/I.B.A. Effective Dates%19.
CS-9/IW;0001;00247220;00000000;00000000;00000000;00000000;00000000;00000000;000XXXXXæ/COD-IT/Effective Dates%19.

Below is the sample for your reference

IC2/I.B.A. Effective Dates%19.                                     IT/Effective Dates%19. IC2/I.B.A. T. XIII, Subt. 5, Ch. 554, UCC Acknowledgments%19.      IT/CAD Acknowledgments%19.  IC2/I.B.A. Nonst. Kefs & Cannos%19.                                IT/Kefs & Cannos%19. IC2/I.B.A. Nonst. Preamble%19.                                     IT/Reaamble%19 IC2/I.B.A. Nonst. Art. 1, |¥1%19.                                  IT/|¥ 1.·Rights of persons%19.    IC2/I.B.A. Nonst. Art. 1, |¥2%19.                                  IT/|¥ 2.·Political power%19.

IC2/I.B.A. Nonst. Art. 1, |¥3%19.                                  IT/|¥ 3.·Will power%19.

OR

I.B.A. Effective Dates%19.                                        Effective Dates%19. I.B.A. T. XIII, Subt. 5, Ch. 554, UCC Acknowledgments%19.         CAD Acknowledgments%19.  I.B.A. Nonst. Kefs & Cannos%19.                                   Kefs & Cannos%19. I.B.A. Nonst. Preamble%19.                                        Reaamble%19 I.B.A. Nonst. Art. 1, |¥1%19.                                     |¥ 1.·Rights of persons%19 I.B.A. Nonst. Art. 1, |¥2%19.                                     |¥ 2.·Political power%19.

I.B.A. Nonst. Art. 1, |¥3%19.                                     |¥ 3.·Will power%19.

Due I need to use the input file twice to get the information “SRP.TEST.K1.B222.R12A.E1.V1.MASTER”

Now I have used

//SORT001 EXEC PGM=SORT                                                    //*JOB TO EXTRACT ONLY FROM A PARTICULAR POSITION IN INPUT AND SEND TO / //SORTIN DD DSN=SRP.TEST.K1.B222.R12A.E1.V1.MASTER,DISP=SHR             //SORTOUT DD DSN=SRP.TEST.IB.B222.R12A.E1.V1.SOR1,UNIT=DISK,            //    SPACE=(CYL,(50,50),RLSE),                                         //    DCB=(RECFM=VB,LRECL=32566,BLKSIZE=32570),                         //    DISP=(NEW,CATLG)                                                  //SYSOUT DD SYSOUT=*                                                    //SYSIN DD *                                                               SORT FIELDS=(96,7,CH,A)                                                    OPTION VLSHRT,VLSCMP –                                                  INCLUDE COND=(96,7,CH,EQ,C’COD-IC2′)                             

      OUTREC FIELDS=(01:1,4,05:5,1,100)                                

 //SORT002 EXEC PGM=SORT                                                     //*JOB TO EXTRACT ONLY FROM A PARTICULAR POSITION IN INPUT AND SEND TO /  //SORTIN  DD DSN=SRP.TEST.K1.B222.R12A.E1.V1.MASTER,DISP=SHR             //SORTOUT DD DSN=SRP.TEST.IB.B222.R12A.E1.V1.SOR2,UNIT=DISK,             //    SPACE=(CYL,(50,50),RLSE),                                          //    DCB=(RECFM=VB,LRECL=32566,BLKSIZE=32570),                          //    DISP=(NEW,CATLG)                                                   //SYSOUT DD SYSOUT=*                                                     //SYSIN DD *                                                                SORT FIELDS=(96,6,CH,A)                                                     OPTION VLSHRT,VLSCMP –                                                   INCLUDE COND=(96,6,CH,EQ,C’COD-IT’)                              

       OUTREC FIELDS=(01:1,4,05:5,1,100)                                

At present the output has C which is in first position getting added for the 1st file

CIC2/I.B.A. Effective Dates%19.

Similar for file 2

CIT/Effective Dates%19.

How to create the sort step to create the desired output in a separate file as given below.

IC2/I.B.A. Effective Dates%19.                                     IT/Effective Dates%19. IC2/I.B.A. T. XIII, Subt. 5, Ch. 554, UCC Acknowledgments%19.      IT/CAD Acknowledgments%19.  IC2/I.B.A. Nonst. Kefs & Cannos%19.                                IT/Kefs & Cannos%19. IC2/I.B.A. Nonst. Preamble%19.                                     IT/Reaamble%19 IC2/I.B.A. Nonst. Art. 1, |¥1%19.                                  IT/|¥ 1.·Rights of persons%19.    IC2/I.B.A. Nonst. Art. 1, |¥2%19.                                  IT/|¥ 2.·Political power%19.

IC2/I.B.A. Nonst. Art. 1, |¥3%19.                                  IT/|¥ 3.·Will power%19.

OR

I.B.A. Effective Dates%19.                                        Effective Dates%19. I.B.A. T. XIII, Subt. 5, Ch. 554, UCC Acknowledgments%19.         CAD Acknowledgments%19.  I.B.A. Nonst. Kefs & Cannos%19.                                   Kefs & Cannos%19. I.B.A. Nonst. Preamble%19.                                        Reaamble%19 I.B.A. Nonst. Art. 1, |¥1%19.                                     |¥ 1.·Rights of persons%19 I.B.A. Nonst. Art. 1, |¥2%19.                                     |¥ 2.·Political power%19.

I.B.A. Nonst. Art. 1, |¥3%19.                                     |¥ 3.·Will power%19.