I have a file1 has:
00123456 optonal test 123
00123478 optonal test 234
00123490 optonal test 567
and file2 has:
0500344
0500345
0500347
I have used the below sort jcl to get the o/p file has:
00123456 optonal test 123
0500344
00123478 optonal test 234
0500345
00123490 optonal test 567
0500347
but in my o/p file the file1 is appending to the file2 data, so could any please help me where i have gone wrong:
//SORTTS1 EXEC PGM=SORT,COND=(0,LT)
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTIN DD DSN=i/p.file1,DISP=SHR
//SORTOUT DD DSN=o/p.file1,DISP=OLD
//SRTMSGE DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,2,CH,A)
INCLUDE COND=(1,2,CH,EQ,C'00',OR,1,2,CH,EQ,C'05')
/*
//SORT0Q EXEC PGM=SORT,COND=(0,LT)
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTIN DD DSN=i/p.file2,DISP=SHR
//SORTOUT DD DSN=o/p.file2,DISP=SHR
//SRTMSGE DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,10,CH,A)
INCLUDE COND(1,2,CH,EQ,C'05')
/*
//MERGE1 EXEC PGM=SORT,COND=(0,LT)
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SRTMSGE DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=o/p.file1,DISP=SHR
// DD DSN=o/p.file2,DISP=SHR
//SORTOUT DD DSN=o/p.file,DISP=OLD
//SYSIN DD *
SORT FIELDS=(1,2,CH,A,1,10,CH,A)
/*
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTIN DD DSN=i/p.file1,DISP=SHR
//SORTOUT DD DSN=o/p.file1,DISP=OLD
//SRTMSGE DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,2,CH,A)
INCLUDE COND=(1,2,CH,EQ,C'00',OR,1,2,CH,EQ,C'05')
/*
//SORT0Q EXEC PGM=SORT,COND=(0,LT)
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTIN DD DSN=i/p.file2,DISP=SHR
//SORTOUT DD DSN=o/p.file2,DISP=SHR
//SRTMSGE DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,10,CH,A)
INCLUDE COND(1,2,CH,EQ,C'05')
/*
//MERGE1 EXEC PGM=SORT,COND=(0,LT)
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SRTMSGE DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=o/p.file1,DISP=SHR
// DD DSN=o/p.file2,DISP=SHR
//SORTOUT DD DSN=o/p.file,DISP=OLD
//SYSIN DD *
SORT FIELDS=(1,2,CH,A,1,10,CH,A)
/*