Preventing an Event from being saved if the MAILBOX parameter is missing.
The EVENTDEF exit may be used to check for a MAILBOX parameter and to prevent the EVENT from being saved if MAILBOX is missing. Sample EVENTDEF exit is provided in the ESP hlq.CD7YSAMP library, member(CYBESS28).
When this exit is called, the first parameter CXDPARM1 points to the Event Definition Record (JEV), and the MAILBOX parameter can be checked here.
Sample codes:
PROC00 DS 0H
L R6,CXDPARM1 Load address of JEV
CLC =H'0',X'D4'(R6) See if JEV has MAILBOX
* above is the offset of the MAILBOX operand in the JEV
BNE EXIT00 Yes, so exit with RC=0
L R5,CXDMSGBA No, so load message buffer addr
MVC 0(MSGL,R5),MESSAGE Copy message to buffer
B EXIT12 and Exit with RC=12
MESSAGE DC AL2(MSGL,0)
DC C'Event definition canceled, MAILBOX is required'
MSGL EQU *-MESSAGE
Sample JCL to assemble and link the exit:
//ASSEMBLE EXEC PGM=ASMA90,REGION=4M,
// PARM='OBJECT,NODECK,SYSPARM(BATCH)'
//SYSLIB DD DSN=hlq.MACLIB,DISP=SHR
// DD DSN=hlq.MODGEN,DISP=SHR
// DD DSN=hlq.CD7YSAMP,DISP=SHR
//SYSUT1 DD DSN=&&SYSUT1,
// SPACE=(1700,(600,100)),UNIT=SYSDA
//SYSUT2 DD DSN=&&SYSUT2,
// SPACE=(1700,(600,100)),UNIT=SYSDA
//SYSUT3 DD DSN=&&SYSUT3,
// SPACE=(1700,(600,100)),UNIT=SYSDA
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DCB=(BLKSIZE=3120,RECFM=FB,LRECL=80),
// DISP=(,PASS,DELETE),
// DSN=HLQ.OBJLIB,
// SPACE=(CYL,(2,1,)),
// UNIT=SYSDA
//SYSIN DD DISP=SHR,DSN=hlq.CD7YSAMP(CYBESS28)
//*
//LINK EXEC PGM=IEWL,
// PARM='LIST,LET,XREF,RENT,REFR,AC=1,NCAL'
//SYSLMOD DD DISP=SHR,DSN=hlq.CD7YLOAD
//OBJLIB DD DISP=MOD,DSN=HLQ.OBJLIB
//SYSUT1 DD SPACE=(CYL,(2,1)),UNIT=SYSDA
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DISP=(MOD,DELETE,DELETE),DSN=HLQ.OBJLIB
// DD DDNAME=SYSIN
//SYSIN DD *
ENTRY EVENTDFX
NAME EVENTDEF(R)
/*
Example: To enable the exit, issue the EXIT initialization parameter, or execute the EXIT command.
EXIT MODULE(EVENTDEF) FUNCTION(EVENTDEF)