I executed the below jcl it was working fine.
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTDIAG DD DUMMY
//SORTIN DD DSN=NO01.XXX.JCL(SXBXJ#01),DISP=SHR
//SORTOF1 DD DSN=NO01.XXX.JCL.SORTOF01,DISP=SHR
//SORTOF2 DD DSN=NO01.XXX.JCL.SORTOF02,DISP=SHR
//*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,2,CH,EQ,C'AM'),FNAMES=SORTOF1
OUTFIL INCLUDE=(3,2,CH,NE,C'AM'),FNAMES=SORTOF2
/*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTDIAG DD DUMMY
//SORTIN DD DSN=NO01.XXX.JCL(SXBXJ#01),DISP=SHR
//SORTOF1 DD DSN=NO01.XXX.JCL.SORTOF01,DISP=SHR
//SORTOF2 DD DSN=NO01.XXX.JCL.SORTOF02,DISP=SHR
//*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,2,CH,EQ,C'AM'),FNAMES=SORTOF1
OUTFIL INCLUDE=(3,2,CH,NE,C'AM'),FNAMES=SORTOF2
/*
i again ran the jcl with little modification, i changed the output DS to PDS,
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTDIAG DD DUMMY
//SORTIN DD DSN=NO01.XXX.JCL(SXBXJ#01),DISP=SHR
//SORTOF1 DD DSN=NO01.XXX.JCL(SXBXJ#02),DISP=SHR
//SORTOF2 DD DSN=NO01.XXXXJCL(SXBXJ#03),DISP=SHR
//*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,2,CH,EQ,C'AM'),FNAMES=SORTOF1
OUTFIL INCLUDE=(3,2,CH,NE,C'AM'),FNAMES=SORTOF2
/*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTDIAG DD DUMMY
//SORTIN DD DSN=NO01.XXX.JCL(SXBXJ#01),DISP=SHR
//SORTOF1 DD DSN=NO01.XXX.JCL(SXBXJ#02),DISP=SHR
//SORTOF2 DD DSN=NO01.XXXXJCL(SXBXJ#03),DISP=SHR
//*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,2,CH,EQ,C'AM'),FNAMES=SORTOF1
OUTFIL INCLUDE=(3,2,CH,NE,C'AM'),FNAMES=SORTOF2
/*
and now the job abend with S213;
i checked the Abend Assist it stated that "The system tried to open a DASD data set and encountered difficulties. This ABEND customarily occurs when the dataset name specified in the DSNAME parameter does not exist.".
But both the DS where present, so I tried like
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTDIAG DD DUMMY
//SORTIN DD DSN=NO01.XXX.JCL(SXBXJ#01),DISP=SHR
//SORTOF1 DD DSN=NO01.XXX.JCL(SXBXJ#02),DISP=SHR
//SORTOF2 DD DSN=NO01.XXX.JCL(SXBXJ#03),DISP=SHR
//*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,2,CH,EQ,C'AM'),FNAMES=SORTOF1
/*
//*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTDIAG DD DUMMY
//SORTIN DD DSN=NO01.XXX.JCL(SXBXJ#01),DISP=SHR
//SORTOF1 DD DSN=NO01.XXX.JCL(SXBXJ#02),DISP=SHR
//SORTOF2 DD DSN=NO01.XXX.JCL(SXBXJ#03),DISP=SHR
//*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,2,CH,EQ,C'AM'),FNAMES=SORTOF1
/*
//*
in the outfil i gave SORTOF1 and 2 separately and tried, then the job executed with RC = 0. Form this i am clear that i made some mistake in the PDS concept, but i am confused , can you please help me understand what mistake i made?
Thanks in Advance,
Gokul