Nach einer Idee von Bob Cozzi...

PHP-Code:
     H BNDDIR('QC2LE'OPTION(*NODEBUGIO:*SRCSTMT)
     
H DFTACTGRP(*NOACTGRP(*NEW) EXTBININT(*YES)

      /
copy qsysinc/qrpglesrc,qusec
      
/copy qsysinc/qrpglesrc,qgy
      
/copy qsysinc/qrpglesrc,qyaspol
      
/copy qsysinc/qrpglesrc,qusgen

     D listSpace       S          65535A
     D QYASP0300_T     DS                  LikeDS
(QYAP0300Inz
     D diskUnit        DS                  LikeDS
(QYASP0300_TInz
     D DU              DS                  LikeDS
(QYASP0300_TBased(pDiskUnit)
     
D pDiskUnit       S               *   InZ(%addr(diskUnit))

     
D closeOpenList   PR                  extPgm('QGY/QGYCLST')
     
D  handle                        4A   OPTIONS(*VARSIZE)
     
D  apiErrorDS                         LikeDS(QUSECOPTIONS(*VARSIZE)

     
D getOpenListE    PR                  extPgm('QGY/QGYGTLE')
     
D  rtnValue                  65535A   OPTIONS(*VARSIZE)
     
D  rtnValueLen                  10I 0 Const
     
D  handle                        4A   Const
     
D  listInfo                     80A   OPTIONS(*VARSIZE)
     
D  reqRtnCount                  10I 0 Const
     
D  strRcd                       10I 0 Const
     
D  apiErrorDS                         LikeDS(QUSECOPTIONS(*VARSIZE)

     
D openASPList     PR                  extPgm('QGY/QYASPOL')
     
D  rtnValue                  65535A   OPTIONS(*VARSIZE)
     
D  rtnValueLen                  10I 0 Const
     
D  listInfo                     80A   OPTIONS(*VARSIZE)
     
D  reqRtnCount                  10I 0 Const
     
D  filterCount                  10I 0 Const
     
D  filterInfo                   80A   OPTIONS(*VARSIZE)
     
D  apiFormat                     8A   Const
     
D  apiErrorDS                         LikeDS(QUSECOPTIONS(*VARSIZE)

     
D openFilter      DS                  Qualified Inz
     D  entrySize                    10I 0 Inz
(%size(openFilter))
     
D  Key                          10I 0 Inz(1)
     
D  dataSize                     10I 0 Inz(4)
     
D  data                         10I 0 Inz(-1)

     
D openListInfo    DS                  Qualified
     D  rcdAvail                     10I 0
     D  rtnRcdCount                  10I 0
     D  Handle                        4A
     D  rcdLen                       10I 0
     D  complete                      1A
     D  crtDTS                       13A
     D  status                        1A
     D  reserved                      1A
     D  rtnLen                       10I 0
     D  rcdOffset                    10I 0
     D  reserved2                    40A

     D  apiError       DS                  LikeDS
(QUSECInz

     D  rcdCount       S             10I 0
     D i               S             10I 0
     D perUsed         S              7P 2
     D perFree         S              7P 2

      
/free
          openASPList
listSpace : %size(listSpace) : openListInfo :
                       -
openFilter 'YASP0300' apiError );
          
rcdCount openListInfo.rtnRcdCount;

          for 
1 to rcdCount;
          
getOpenListE(diskUnit : %size(diskUnit) : openListInfo.Handle :
                          
openListInfo apiError );

           
// At this point, the DiskUnit struct has the returned Disk info.
           // Calc the percentage used and free for each disk unit
           
perFree = %DEC((du.qyalable du.qyatotal00) * 100 72);
           
perUsed 100 perFree;

          endfor;

          
closeOpenListopenListInfo.Handle apiError);
          *
inlr = *on;
          return;
      /
end-free