Oh, das ding ist gar nicht vom OS

Code:
H DFTACTGRP(*NO) OPTION(*SRCSTMT : *NODEBUGIO)                     
H COPYRIGHT('(c) 2006 - Robert Cozzi, Jr. - All rights reserved.') 
                                                                   
 *************************************************************     
 **  RTVJOBD - Retrieve Job Description Command Proc Pgm.          
 **            This program returns the library list               
 **            of the specified Job Description ("jobd").          
 **            In addition, the number of library names            
 **            in the jobd's library lis is also returned.         
 **            See the associated RTVJOBD CMD source for use       
 **            in CL.  TIP: The return variables in your CL        
 **            program should be defined as follows:               
 **               DCL &LIBL    TYPE(*CHAR) LEN(2750)               
 **               DCL &LIBLCNT TYPE(*INT)  LEN(2)                  
                                                                   
D RtvJobDCL       PR                                               
D  szJobD                       20A   Const                        
D  rtnLIBL                    2750A                                
D  rtnLIBLCount                  5I 0                              
                                                                   
D RtvJobDCL       PI                                     
D  szJobD                       20A   Const              
D  rtnLIBL                    2750A                      
D  rtnLIBLCount                  5I 0                    
                                                         
 /COPY QSYSINC/QRPGLESRC,QWDRJOBD                        
 /COPY QSYSINC/QRPGLESRC,QUSEC                           
 **  Retrieve Job Description                            
D*QWDRJOBD        PR                  ExtPgm('QWDRJOBD') 
D RtvJobDAPI      PR                  ExtPgm('QWDRJOBD') 
D  szRtnBuffer               65535A   OPTIONS(*VARSIZE)  
D  nRtnBufLen                   10I 0 Const              
D**  Specify 'JOBD0100'                                  
D  apiFormat                     8A   Const              
D  JobD                         20A   Const              
D  api_error                          LikeDS(QUSEC)      
                                                         
D JobD            DS                  LikeDS(QWDD0100)   
D                                     Based(pJobD)       
 
D JobDInfo        DS                  LikeDS(QWDD0100)              
                                                                    
D LibList         S             11A   Based(pLIBL) DIM(250)         
D LibL            S           2750A   Based(pLIBL)                  
D APIErrDS        DS                  LikeDS(QUSEC)                 
                                                                    
C                   eval      *INLR = *ON                           
 **  Sadly, with this API, we need to call it twice when            
 **  the LIBL is needed.                                            
 **  First call: Get the length of the data to be returned.         
C                   eval      APIErrDS= *ALLX'00'                   
C                   eval      APIErrDS.QUSBPRV = %size(APIErrDS)    
C                   eval      JobDInfo = *ALLX'00'                  
C                   callp     RtvJobDAPI(JobDInfo : %size(JobDInfo):
C                                     'JOBD0100': szJOBD : APIErrDS)
                                                                    
C                   if        APIErrDS.QUSBAVL = 0                  
C                   eval      pJobD = %Alloc(JobDInfo.QWDBAVL)      
C                   eval      JOBD = *ALLX'00'                      
 **  Second call: Get the library list.                             
C                   callp     RtvJobDAPI(JOBD : JobDInfo.QWDBAVL :  
C                                     'JOBD0100': szJOBD : APIErrDS)
C                   if        %Parms >= 3                           
C                   eval      rtnLIBLCount = JobD.QWDNLILL          
C                   endif                                           
C                   if        %Parms >= 2                           
 /free                                                              
   pLibl = pJobD + JobD.QWDOILL;                                    
   rtnLibl = %subst(LIBL:1:JobD.QWDNLILL*%size(LibList));           
 /end-free                                                          
C                   endif                                           
C                   deAlloc                 pJobD                   
C                   endif
und

Code:
             CMD        PROMPT('Liblist v.Jobd lesen RTBJOBD')      
             PARM       KWD(JOBDT) TYPE(QUAL1)  +                   
                          PROMPT('JOBD')                            
             PARM       KWD(RTNLIB) TYPE(*CHAR) LEN(2750) +         
                          RTNVAL(*YES) CHOICE('VAR FÜR LIBL (CHAR + 
                          2750)')                                   
             PARM       KWD(RTNANZ) TYPE(*INT2) RTNVAL(*YES) +      
                          CHOICE('VAR FÜR ANZAHL (*CHAR )')         
 QUAL1:      QUAL       TYPE(*NAME)                                 
             QUAL       TYPE(*NAME)     PROMPT('LIB') DFT('     ')