ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Library Size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Library Size

    Hi all
    I have one query

    Is it possible to get the size of Library with all objects in it.

    Size retrieval in RPG and CL any of these is acceptable.

    e.g. LIB01 (Size 100B) have objects OB1 (200 B) and OB2 (300 B) then is it possible to get total size in CL by use of some command i.e. command should retrieve size 600 B.

    RTVOBJD retrieves only Library size i.e. 100 B in above example.

    Thanks

  • #2
    Re: Library Size

    Hi instrucrat1,

    Do you need this information daily or real time.

    We run a nightly RTVDSKINF that takes an average of 4 hrs (2-9hrs range depending on load) over 25TB of data in 40TB disk.

    This replaces the data in file QUSRSYS/QAEZDISK.

    We then copy this file to a work file and run queries over it, as you can then sum up the total space used by library etc. You can even graph daily figures and see trends, or even alert on new libraries or libraries deleted.

    Groups of libs with the same prefix (eg TESTLib1, TESTLib2 etc) can be totalled to give all TEST* lib sizes (for departmental totals etc)

    Realtime you can do DSPLIB lib-name *PRINT, this will produce a spoolfile with the total at the bottom of the lib size, for large libs do this in batch.

    You could also do a DSPOBJD of Lib-Name/*ALL to an outfile, which will list all objects in that lib, then you can add up via program or query the object sizes you need to check. (Again do this in batch for large libs)

    Hope this helps ...

    GC
    Greg Craill: "Life's hard - Get a helmet !!"

    Comment


    • #3
      Re: Library Size

      Hi instrucrat1,

      We have used the following CL program for more than 10 years now.

      Code:
       Pgm Parm(&Lib)                                                                         
         dcl  &Lib     *char len(10)                                                          
         dcl  &Size    *dec  len(15)                                                          
         dcl  &MbSize  *dec  len(9 3)                                                         
         dcl  &MbSize_ *char len(9)                                                           
         dcl  &Mega    *dec  len(15) value(1048576)                                           
                                                                                              
         Dclf  QADSPOBJ                                                                       
                                                                                              
      /* Display Object Description for all objects in the library into "LibSize" in qtemp */ 
         DspObjD   Obj(&Lib/*All) ObjType(*All) OutPut(*OutFile) OutFile(Qtemp/LibSize)       
         OvrDbf    File(QADSPOBJ) ToFile(Qtemp/LibSize)                                       
                                                                                              
      /* Loop through all the records in the file and add object size to &Size */              
      Loop:                                                                                   
         Rcvf                                                                                 
         MonMsg (cpf0000) exec(goto eof)                                                      
         ChgVar &Size (&Size + &OdObSz)                                                       
         goto loop                                                                            
                                                                                                          
      Eof:                                                                                                
                                                                                                          
      /* Calculate mega bytes */                                                                          
         ChgVar &MbSize (&Size / &Mega)                                                                   
                                                                                                          
         ChgVar &MbSize_ &MbSize /* Convert to char */                                                    
         SndPgmMsg MsgId(cpf9898) Msgf(QCPFMSG) MsgDta('Library size in mega bytes :' !> &Lib !> &MbSize_)
                                                                                                          
      
      EndPgm
      I hope this can help you

      Regards,

      Bent

      Comment


      • #4
        Re: Library Size

        hi

        You can use the below command:

        DSPLIB LIB(Library_Name) OUTPUT(*PRINT)

        it will create a spool file in which u can get the list of objects in the library with their storage space occupied.

        correct me if i am wrong..

        cheers

        Comment


        • #5
          Re: Library Size

          Hi,

          there is also a freeware tool called LIBSIZE. Have a look at it.
          its located on:



          BR,
          Konni
          Attached Files
          Last edited by jamief; December 19, 2006, 05:57 AM. Reason: added zipfile

          Comment


          • #6
            Re: Library Size

            Thaks a lot.
            Is there any API who can retrieve lib size?

            Thanks,

            Comment

            Working...
            X