Midrange News for the IBM i Community


Posted by: Jeff Masak
IT Developer
The Boldt Co
Appleton, WI
Retrieving Library Lists in a Job Description
has no ratings.
Published: 27 Dec 2012
Revised: 23 Jan 2013 - 1703 days ago
Last viewed on: 22 Sep 2017 (4152 views) 

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.

Retrieving Library Lists in a Job Description Published by: Jeff Masak on 27 Dec 2012 view comments(7)

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 26 days 7 hours 44 minutes ago

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.

Posted by: TFisher
Premium member *
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 21 days 23 hours 6 minutes ago

I use the QWdrJobD API (JOBD0100 Format) to retrieve the initial library list for job de!--script--ions. 

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 20 days 10 hours 49 minutes ago

TFisher

 

Would you be able to post an example on how to use this API (QwdrjobD).

 

Thanks

Jeff

Posted by: Viking
Premium member *
CA
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 20 days 9 hours 2 minutes ago

If you have TAATOOLS, this might give you what you need:

http://www.taatool.com//document/L_dspjobdlib.htm

 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 20 days 7 hours 54 minutes ago
Edited: Wed, 02 Jan, 2013 at 11:38:48 (1724 days ago)

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 

 

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 20 days 7 hours 12 minutes ago

Beat me by a few minutes, Bob. Jeff, do you understand Bob's code? It's fairly straightforward pointer arithmetic.

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: Retrieving Library Lists in a Job Description
Posted: 4 years 8 months 20 days 3 hours 13 minutes ago

Got it and it works.  Thanks to all Jeff