The S02A abend is related to improper serialization of the Internal Reader.
This abend typically happens when the WTOEXIT and a user defined SYSOUTL LINE name the same DD for the Internal Reader.
The sample WTOEXIT writes JCL to a DD called JESRDR. Most clients use this DD in their WTOEXIT and define this DD in their CV startup JCL as follows:
//JESRDR DD SYSOUT=(A,INTRDR),DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
Many CVs also define a SYSOUTL LINE in Sysgen that is used by user applications so they can submit JCL to the Internal Reader.
The DDNAME parameter specified in the SYSOUTL LINE definition must be something other than the DDNAME which the WTOEXIT uses to write JCL to the internal reader.
For example:
Assuming you have a SYSOUTL LINE called SUBJCL as follows (The LINE name can be anything, it does not have to be SUBJCL):
ADD LINE SUBJCL
ENABLED
NOCOMPACT
PROTOCOL IS DEFRESP
TYPE IS SYSOUTL
DDNAME IS JESRDR. <--- This DDNAME needs to change because WTOEXIT uses JESRDR
MODIFY LINE SUBJCL
ENABLED
NOCOMPACT
PROTOCOL IS DEFRESP
TYPE IS SYSOUTL
DDNAME IS INTRDR. <---- A DDNAME that is not used by WTOEXIT or any other SYSOUTL Line in the CV.
I then add the INTRDR DD to my startup JCL so there are now two DDs for the Internal Reader, one for WTOEXIT to use and one for user applications to use via the SYSOUTL LINE.
//JESRDR DD SYSOUT=(A,INTRDR),DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//INTRDR DD SYSOUT=(A,INTRDR),DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
This will prevent the S02A abends related to Internal Reader Serialization errors.