... then things got even more interesting. Coworker noticed one
performance on one system was tanking. Somehow this process was spawning
an infinite number of jobs on one of the target systems. We have it beat
into submission.
Current temporary used . : 74568 M
Peak temporary used . . : 950142 M

I wrote a procedure to kill the jobs:
CREATE PROCEDURE PROCESS_JOBS
(IN IN_CURRENT_USER *VARCHAR*(*10*),
IN IN_JOB_NAME *VARCHAR*(*10*) )
LANGUAGE SQL MODIFIES SQL DATA
SET OPTION DATFMT = *ISO
P1: BEGIN
DECLARE QUALIFIED_JOB_NAME *CHAR*(*28*);
DECLARE COMMAND *CHAR*(*200*);
*-- Ensure this is large enough.* DECLARE END_TABLE *INT* DEFAULT
*0*;
DECLARE C1 CURSOR FOR

SELECT JOB_NAME
FROM TABLE(QSYS2.ACTIVE_JOB_INFO(
CURRENT_USER_LIST_FILTER *=>* IN_CURRENT_USER,
JOB_NAME_FILTER *=>* IN_JOB_NAME
));
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET END_TABLE = *1*;

*-- DECLARE EXIT HANDLER FqsysOR SQLEXCEPTION*
*-- SET DEPT_SALARY = NULL;* OPEN C1;
FETCH C1 INTO QUALIFIED_JOB_NAME;
WHILE END_TABLE = *0* DO
SET COMMAND = 'ENDJOB JOB(' *CONCAT* QUALIFIED_JOB_NAME
*CONCAT* ') OPTION(*IMMED) SPLFILE(*YES) LOGLMT(0)';
CALL QSYS2.QCMDEXC(COMMAND);
FETCH C1 INTO QUALIFIED_JOB_NAME;
END WHILE;
CLOSE C1;
END P1
;
CALL ROB.PROCESS_JOBS('ROB', 'QRWTSRVR');

Big reason why I use stored procedures instead of CL for much of this stuff
now.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.