You can use CAZ1REXX to produce an error message if a JCLLIB statement is not present in the JCL.
Use the hlq.CAZ2CLS0 member CAZ1REXX and add the following statements:
In the JOB_PROCESSING section, set the the flag to N.
JCLLIB = N
In the DD_PROCESSING section, set the flag to Y if JCLLIB statement is found
If DD.DDNAME = 'JCLLIB' then do
JCLLIB = Y
In the END_JOB_PROCESSING section, issue a message if the flag for JCLLIB flag is still N
If JCLLIB = N Then do
Call $CAJCL_ERROR 'E',
'PLEASE ADD MISSING JCLLIB STATEMENT'
This will produce the following error message:
CAY6341E 'PLEASE ADD MISSING JCLLIB STATEMENT'