For those of us who haven't finished consolidation of tables by company...
PHP Code:
d count s 2 0
d Current s 10
d SkipLibs s 3 0
//
// External Calls
//
d $GetLibList PR ExtPgm('QUSRJOBI')
d RcvVar 32767 Options(*VarSize)
d LengthRcv 10I 0 Const
d FormatName 8A Const
d QualJobName 26 Const
d InternalJobId 16 Const
d Error_ds 15
//
// Data Structures
//
d ds_job10700 Ds 32767
d BYTRTN 10i 0
d BYTVAL 10i 0
d QJOBNM 9 34
d JOBNAM 9 18
d USRNAM 19 28
d JOBNBR 29 34
d INTID 35 50
d JOBSTS 51 60
d JOBTYP 61 61
d SUBTYP 62 62
d RESRV 63 64
d SYSLIB 10i 0
d PRDLIB 10i 0
d CURLIB 10i 0
d USRLIB 10i 0
d LIB1 81 336
d ds_Error Ds 15
d BytesProvided 10I 0 inz(%size(ds_Error))
d BytesAvail 10I 0
d ErrorId 7
//
// holds all the user libraries... this will be used to reset libl after
// processing for another company
d MyLibraries ds 2500 qualified
d Library 11 dim(200) overlay(MyLibraries:1)
/Free
//------------------------------------------------
// C a l c u l a t i o n S p e c s
//------------------------------------------------
$getLibList(ds_job10700:%Size(ds_job10700):'JOBI0700'
:'*' : *Blanks : ds_Error);
SkipLibs = (SysLib + PrdLib)*11;
Current = %trim(%subst(LIB1:SkipLibs + 1:10));
if curlib = *zeros;
current = '*NONE';
Mylibraries = %trim(%subst(LIB1:SkipLibs + 1));
else;
Mylibraries = %trim(%subst(LIB1:SkipLibs + 11));
endif;
for count = 1 to %elem(MyLibraries.library);
if MyLibraries.library(count) <> *blanks;
dsply MyLibraries.Library(count) ' ';
else;
Leave; // thats right a Leave!
endif;
endfor;
*inlr = *on;
/end-free
//--------------------------------------------------------