Summary:
Can I use the EVENTDEF ESP Exit to NOT allow an ESP event to be defined or updated if it does not have a MAILBOX parameter coded on the EVENT statement? If so, is there a coding example?
Instructions:
The EVENTDEF exit may be used to check for a MAILBOX parameter, and to prevent the EVENT from being saved if MAILBOX is missing.
A sample EVENTDEF exit is provided in the ESP CD7YSAMP library, member name 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
Additional Information:
Sample JCL to assemble and link the exit:
//ASSEMBLE EXEC PGM=ASMA90,REGION=4M,
// PARM='OBJECT,NODECK,SYSPARM(BATCH)'
//SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
// DD DSN=SYS1.MODGEN,DISP=SHR
// DD DSN=CAI.ESP.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=CAI.ESP.CD7YSAMP(CYBESS28)
//*
//LINK EXEC PGM=IEWL,
// PARM='LIST,LET,XREF,RENT,REFR,AC=1,NCAL'
//SYSLMOD DD DISP=SHR,DSN=CAI.ESP.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)
/*
To enable the exit, issue the EXIT initialization parameter, or execute the EXIT command.
Example: EXIT MODULE(EVENTDEF) FUNCTION(EVENTDEF)
The EXIT initialization parameter is documented in the ESP Installation and Configuration Guide chapter D.
The EXIT command is documented in the ESP Command Reference Guide.