/* --- IOFRELCN -- Release or CANCEL INPUT jobs on TYPRUN=HOLD ------*/ PROC 2 FUNCTION /* Function. RELEASE or CANCEL */+ JOB_NAME /* Name of job to release or cancel */+ TEST /* Trace CLIST if specified */ CONTROL END(ENDO) NOFLUSH ASIS IF &TEST = TEST THEN CONTROL LIST CONLIST SELECT WHEN (&FUNCTION = CANCEL) SET ACTION = Canceling WHEN (&FUNCTION = RELEASE) DO SET FUNCTION = A SET ACTION = Releasing ENDO OTHERWISE DO SET FUNCTION = '' SET ACTION = Found ENDO ENDO /* Issue IOF command to get a list of HELD INPUT JOBS with matching */ /* JOBNAME. Only get jobs submitted by this user. */ IOF &JOB_NAME JOBLIST INPUT SELECT(HELD) SCOPE(ME) CLIST /* How many jobs were found? Variable ROWS will contain the number */ /* of rows on the screen, which is the number of jobs found */ TSICOPY NAME(ROWS) TO(CLIST) SECTION(PANEL) /* EXTEND the display so that extended fields are accessable */ EXTEND /* If no jobs were found, give error message */ IF &ROWS = 0 THEN + WRITE &JOB_NAME is not a held input job, &FUNCTION not done /* Issue a message for each found job, then CANCEL or RELEASE */ ELSE DO MENUNBR = 1 TO &ROWS /* Retrieve the jobname, jobid, etc for job with current MENUNBR */ &MENUNBR TSICOPY NAME(JOBNAME JOBID OWNER USERNAME RAN) TO(CLIST) /* Format CANCELING or RELEASING message and issue it */ SET JOBNAME = &JOBNAME SET OWNER = &OWNER SET USERNAME= &USERNAME WRITE &ACTION job &JOBNAME(&JOBID) submitted by &OWNER + &USERNAME at &RAN /* CANCEL or RELEASE the current job at row "MENUNBR" */ IF &FUNCTION NE '' THEN DO &MENUNBR &FUNCTION /* Check Return Code. If non-zero, issue IOF error message and */ /* force return code 4. */ IF &LASTCC NE 0 THEN DO TSICOPY NAME(MESSAGE) SECTION(PANEL) TO(CLIST) WRITE *** ERROR *** &MESSAGE SET ROWS = 0 ENDO ENDO ENDO /* Exit from IOF */ JUMP X /* Exit with return code: 0 - jobname found 4 - not found */ IF &ROWS = 0 THEN EXIT CODE(4) ELSE EXIT CODE(0)