Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Is there a way to retrieve and print a libray list that is in a Job Description? We are in the process of cleaning up Old Moldy Libraries on our system and want to find out if any of our job descriptions contain the libraries we want to delete. Any help and/or example on how this could be done is appreciated. I have looked at API QWDRJOBD but am not sure how to use it. Thanks Jeff
I thought I had something on this in one of my bags of tricks, but I don't. Shouldn't be too difficult to do it yourself, however.
I use the QWdrJobD API (JOBD0100 Format) to retrieve the initial library list for job de!--script--ions.
TFisher
Would you be able to post an example on how to use this API (QwdrjobD).
Thanks
Jeff
If you have TAATOOLS, this might give you what you need:
http://www.taatool.com//document/L_dspjobdlib.htm
This isn't beautiful, but it does exactly what you want.
H DFTACTGRP(*NO) OPTION(*NODEBUGIO:*SRCSTMT) ACTGRP(*NEW) H EXTBININT(*YES) H BNDDIR('COZTOOLS/COZTOOLS') /include cozTools/qcpysrc,qusec /include cozTools/qcpysrc,apiProtos /include cozTools/qcpysrc,joblog /include qsysinc/qrpglesrc,qwdrjobd D apiData S 5000A D pAPIData S * Inz(%Addr(apiData)) D jd DS likeDS(QWDD0100) D based(pAPIData) D libl S 11A DIM(255) D based(pLibl) D apiError DS likeDS(QUSEC_T) Inz D lib S 11A D i S 10I 0 D entryPList PR extPgm('DSPJDLIBL') D jobd 20A Const D entryPList PI D jobd 20A Const C MOVE *ON *INLR /free // NOTE: I had to use QWDRJOBD2 prototype from COZTOOLS since // IBM doesn't know how to name data Structures for RPG // in the QSYSINC library. qwdrjobd2(apiData : %len(apiData) : 'JOBD0100' : jobD : apiError); if (apiError.QUSBAVL > 0); // Error? // failed, so return to caller return; endif; joblog('Job De!--script--ion . . . . . . . %s': jd.qwdjdn); joblog(' Library . . . . . . . . . . %s': jd.qwdjdln); joblog('Test de!--script--ion . . . . . . . %s': jd.qwdtd); joblog('Job Queue . . . . . . . . . . %s': jd.qwdjqn00); joblog(' Library . . . . . . . . . . %s': jd.qwdjqln00); joblog('Output Queue . . . . . . . . . %s': jd.qwdOQN); joblog(' Library . . . . . . . . . . %s': jd.qwdOQLN); joblog('Log CL Programs . . . . . . . %s': jd.qwdLCLP); joblog('Number of LIBL entries . . . . %s': %char(jd.qwdnlill)); pLibl = %addr(apiData) + jd.qwdoill; for i = 1 to jd.qwdnlill; if (i = 1); joblog('Library List Entries . . . . . %s': libl(i)); else; joblog(' %s': libl(i)); endif; endfor; /end-free
Beat me by a few minutes, Bob. Jeff, do you understand Bob's code? It's fairly straightforward pointer arithmetic.