**free ctl-opt nomain; /copy indebug_pr dcl-proc inDebug export; dcl-pi *n ind end-pi; dcl-pr QteRetrieveDebugAttribute extproc(*dclcase); attribute char(10) const; value char(10); errorcode likeds(qusec); end-pr; dcl-s dummy char(10); /copy qsysinc/qrpglesrc,qusec // Set the bytes-provided subfield in the error code parameter // so that the API will return error information in the parameter QUSBPRV = %size(QUSEC); QteRetrieveDebugAttribute ('*UPDPROD' // pick any attribute : dummy : qusec); // If QUSBAVL (bytes-available) is greater than zero, // an error occurred. If the error is CPF9541, then // debug is not active if QUSBAVL > 0 and QUSEI = 'CPF9541'; return '0'; // job is not in debug mode else; return '1'; // job is in debug mode endif; end-proc;