AnsweredAssumed Answered

Can I pass a value from a jobdef directly to an alert proc?

Question asked by mbieganski on Nov 21, 2018
Latest reply on Nov 22, 2018 by Lucy_zhang

Hello Forum,

Given jobdef for job XYZ that triggers alert MPB if overdue:
JOB XYZ
   MAXRUNTIME=1
   NOTIFY OVERDUE ALERT(MPB) USERS(yada)
   RUN ANY
ENDJOB

 

Here is the MPB alert's proc below;
It passes values like CI QUEUE etc from the
alert proc intto the SENDMAI4 jcl:

 

MPB alertproc:

IF %MNJOB EQ 'XYZ' THEN -
  DO
  CI = 'ca workload automation (jss)'
  QUEUE = 'racf'

  IMPACT = '4'
  TITLE = 'Mainframe Job Overdue %MNJOB'
ENDDO
SUBMIT 'A#B.ESPMAINT.CNTL(SENDMAI4)'

 

But we'd like to be able to set variables like QUEUE, IMPACT etc inside the XYZ jobdef  rather than inside the alert's proc so that the alert itself has something like QUEUE = %yadayada   IMPACT = %impct

Thus we can use the alert proc for many jobs by amending each of the jobdefs that invoke it as appropriate;

Is there anyway that I can pass values like
QUEUE etc from the XYZ jobdef to the MPB alert proc
rather than  having to hardcode all the
values in the alert proc?  (sort of like how the alert uses %MNJOB...

 

eg looking to be able to do something like this:

JOB XYZ
   MAXRUNTIME=1
   NOTIFY OVERDUE ALERT(MPB) USERS(yada)

   CI = 'ca workload automation (jss)'

   QUEUE = 'racf'

   IMPACT = '4'

  RUN ANY
ENDJOB

 

and in the alert's proc be able to glean the values from the invoking jobdef and

then pass along CI and QUEUE into the sendmai4 jcl

IF %MNJOB EQ 'XYZ' THEN -
  DO
  CI ='%CI
  QUEUE = %QUEUE

  IMPACT = '4'
  TITLE = 'Mainframe Job Overdue %MNJOB'
ENDDO
SUBMIT 'A#B.ESPMAINT.CNTL(SENDMAI4)'

 

thanks 

Outcomes