× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here is an simple RPG program to retrieve the complete library list.  

You can add this to your TAATOOL lookalikes.  Main differences: it's
free and you won't have to fight for it.  (We're here to help each 
other out, I believe).

Kirk:  You can see how the error return structure is used by looking
at this example.  Two birds with one stone.

The program does not allow for more than 25 libraries in a *LIBL (not
currently a problem).  It's the only shortcoming I can think of.
Enjoy.


  (The following signature looks right only with a fixed-pitch font)
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
*      _                                                      _       *
*     / )                                                    ( \      *
*  _ / /                  Dennis Lovelady                     \ \ _   *
* ( ( ()    _      Unix / AIX System Administrator       _    () ) )  *
*( \ \ \)  / )             Oracle D.B.A.                ( \  (/ / / ) *
( \ \ \ \_/ /   http://cybercity.piedmont.net/~dennis    \ \_/ / / / )*
*\         /            Dennis@Lovelady.com               \         / *
* \       /          Dennis.Lovelady@KEMET.com             \       /  *
/~~\     /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\     /~/\* 
   [[[|]]]               Simpsonville, SC.                  [[[|]]](  *
\__[[[|]]]__________________________________________________[[[|]]]_\/

     H/TITLE Retrieve a job's complete library list                    
      * Dennis Lovelady, 25 Nov. 1997                                  
     ** This program will use the QUSRJOBI API to retrieve the         
     ** specified job's library list.                                  
     **                                                                
     ** Parameters:                                                    
     **    1  CHAR(10)  Job name                                       
     **    2  CHAR(10)  User name                                      
     **    3  CHAR(10)  Job number                                     
     **    4  LGL       '1' = Success; '0' = failure                   
     **    5  CHAR(250) Array of up to 25 libraries                    
     **    6  CHAR(25)  (Optional) Type of entry for each library:     
     **                  'S' = System; 'P' = Product; 'C' = Current    
     **                  'U' = User                                    
     **                 (indicates what portion of the library list    
     **                  contains this entry)                          
     E                    JLIB       25 11                             
     E                    LIBS       25 10                             
     E                    TYPE       25  1                             
     IPGMDS      SDS                                                   
     I                                       37  390#PARM             
     I$JOB        DS                                                  
     I                                        1  10 $JNAME            
     I                                       11  20 $JUSER            
     I                                       21  26 $JNBR             
     IERRDS       DS                                                  
     I I            16                    B   1   40ERRPRO            
     I I            0                     B   5   80ERRAVL            
     I                                        9  15 ERRID             
     IWORKDS      DS                                                  
     I* The INFLEN variable must conatin the length of the JOBINF     
     I* data structure which follows.                                 
     I I            355                   B   1   40INFLEN            
     IJOBINF      DS                                                  
     I                                    B   1   40JOBRTN            
     I                                    B   5   80JOBAVL            
     I                                        9  18 JOBNAM            
     I                                       19  28 JOBUSR            
     I                                       29  34 JOBNBR            
     I                                       35  50 JOBID             
     I                                       51  60 JOBSTS      
     I                                       61  61 JOBTYP      
     I                                       62  62 JOBSTP      
     I*                                      63  64 Reserved    
     I                                    B  65  680JOB#SY      
     I                                    B  69  720JOB#PR      
     I                                    B  73  760JOB#CU      
     I                                    B  77  800JOB#US      
     I                                       81 355 JLIB        
     C           *ENTRY    PLIST                                
     C                     PARM           PJNAME 10             
     C                     PARM           PJUSER 10             
     C                     PARM           PJNBR   6             
     C                     PARM           POK     1             
     C                     PARM           PLIBS 250             
     C                     PARM           PTYPE  25             
     C/EJECT                                                    
     C                     SETON                     LR         
     C                     MOVELPJNAME    $JNAME                
     C                     MOVELPJUSER    $JUSER                
     C                     MOVELPJNBR     $JNBR             
     ** Call the API
     C                     CALL 'QUSRJOBI'                  
     C                     PARM           JOBINF            
     C                     PARM           INFLEN            
     C                     PARM 'JOBI0700'FORMAT  8         
     C                     PARM           $JOB              
     C                     PARM *BLANK    JOBINT 16         
     C                     PARM           ERRDS             
     ** ERRAVL will be zero if no error occurred.  In case of an error, we
     ** will simply pass back a '0' success flag.  However, the ERRID 
     ** variable could be passed back, to give the caller some idea of the
     ** cause of the problem
     C           ERRAVL    IFGT *ZERO                       
     ** Error
     C                     MOVE *BLANK    LIBS              
     C                     MOVE *BLANK    TYPE              
     C                     MOVEL'0'       POK               
     C                     ELSE                             
     ** Success
     C                     MOVEL'1'       POK               
     C                     Z-ADD*ZERO     I       30        
     C                     Z-ADD*ZERO     O       30        
     ** Grab all of the "SYSTEM" libraries first...
     C           1         DO   JOB#SY                      
     C                     ADD  1         I                 
     C                     ADD  1         O                 
     C                     MOVELJLIB,I    LIBS,O            
     C                     MOVEL'S'       TYPE,O              
     C                     ENDDO                              
     ** Product libraries are listed next...
     C           1         DO   JOB#PR                        
     C                     ADD  1         I                   
     C                     ADD  1         O                   
     C                     MOVELJLIB,I    LIBS,O              
     C                     MOVEL'P'       TYPE,O              
     C                     ENDDO                              
     ** There will be zero or 1 "current" libraries next
     C           1         DO   JOB#CU                        
     C                     ADD  1         I                   
     C                     ADD  1         O                   
     C                     MOVELJLIB,I    LIBS,O              
     C                     MOVEL'C'       TYPE,O              
     C                     ENDDO                              
     ** Finally, retrieve the *USRLIBL libraries
     C           1         DO   JOB#US                        
     C                     ADD  1         I                   
     C                     ADD  1         O                   
     C                     MOVELJLIB,I    LIBS,O              
     C                     MOVEL'U'       TYPE,O              
     C                     ENDDO                              
     ** Now, prepare to send the data back to the caller.  LIBS is
     ** required, so we won't test for its presence.
     C                     MOVEALIBS      PLIBS               
     C           #PARM     IFGE 6                             
     ** #PARM will be 6 if a "Library list entry types" parameter
     ** was passed.  In that case, fill that variable.
     C                     MOVEATYPE      PTYPE               
     C                     ENDIF                              
     C                     ENDIF                              
     ** Get out of here... we're done.
     C                     RETRN                              





Al Barsa* Jr. <barsa2@ibm.net> on 11/24/97 09:43:54 PM
To: MIDRANGE-L <MIDRANGE-L@midrange.com> @ INTERNET
cc:  
Subject: Re: Retrieving library list when running

At 03:20 PM 11/24/97 -0500, you wrote:
>Where is the best (or most accurate) place to get the library list from
>when my program is running?
>
>This is so I can display it (if I need to) while running.  I know I can do
>it thru RTVJOBA and by DSPLIBL.  I'd like to be able to get the full
>picture of the library list being used.
>
True, RTVJOBA doesn't do the full job.  However, it does provide the
USRLIBL, SYSLIBL and CURLIB.  What it omits is PRDLIBL.  

You could ask us to provide a TAATOOL, or you could submit a requirement to
IBM.  I think a TAATOOL would be do-able.

Al

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.