Home > AS/400 Tips > iSeries programmer tips > Get a report of large files and total records in a library
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Get a report of large files and total records in a library


DAVID ANDERSON
01.09.2003
Rating: -2.86- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Get a report of large files and the total number of records in a library. I run this below job on the weekends to help manage files that need purging, or test libraries that my programmers forget to clean up.



Code

  
  
***** OBJSIZE CLP  *********
SOURCE FILE . . . . . . .  EM400/QCLSRC
  MEMBER  . . . . . . . . .  OBJSIZE
  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
    100              PGM
    200
    300              DCL        VAR(&EML_ADR) TYPE(*CHAR) LEN(40) VALUE(' ')
    400              DCL        VAR(&SUBJECT) TYPE(*CHAR) LEN(50) +
    500                           VALUE('SIZE OF OBJECTS ON SYSTEM')
    600              DCL        VAR(&PRE_FIX) TYPE(*CHAR) LEN(3) VALUE('OBJ')
    700              DCL        VAR(&SIZE) TYPE(*CHAR) LEN(3) VALUE('132')
    800              DCL        VAR(&FILE_NAME) TYPE(*CHAR) LEN(10) +
    900                           VALUE('QPQUPRFIL')
   1000              DCL        VAR(&ARC_DLT) TYPE(*CHAR) LEN(3) VALUE('DLT')
   1100              DCL        VAR(&EXTRA) TYPE(*CHAR) LEN(512) VALUE(' ')
   1200
   1300
   1400              CHGVAR     VAR(%SST(&EXTRA 1 20)) VALUE('OBJSIZE')
   1500              CHGVAR     VAR(%SST(&EXTRA 21 20)) VALUE('OBJSIZE')
   1600
   1700
   1800              CLRPFM     FILE(OISTST/SYSSIZE)
   1900              DSPOBJD    OBJ(*ALL/*ALL) OBJTYPE(*FILE *JRN *JRNRCV) +
   2000                           OUTPUT(*OUTFILE) OUTFILE(OISTST/SYSSIZE)
   2100
   2200              OVRPRTF    FILE(QPQUPRFIL) PAGESIZE(66 127) LPI(6) +
   2300                           CPI(15) FORMTYPE(0088) COPIES(1)
   2400              RUNQRY     QRY(OISTST/SYSLISTPF)
   2500              DLTOVR     FILE(*ALL)
   2600
   2700              ENDPGM

****** SAMPLE REPORT  ****
Library     Object      Object               Object   Text description      
                        Type                 Size                           

TESTLIB     ACCMAST     PF                3,026,944   Accident Report file 
            ACCMAST715  PF                2,801,664   Accident Report file 
            ACITIES2    PF                7,798,784   City file FOR PHONE C
            AGTCUSTPF   PF               11,120,640   Agent customer file  
            APAGCK      PF              130,183,168   A/P Agent Issued Chec
            APCLAUDPF   PF               19,955,712   AP AUDIT file when en
            ARCUSTWK    PF               30,466,048   ARCUST(Ma) - A/R cust
            BITMST      PF                1,187,840   Order Master File for
            BLWAPSHOW   PF               29,130,752   FIRST QUERY TO BE DON
            BORDR       PF              305,520,640   PHY       Billing ord
            BORDRL      PF              418,955,264   PHY       Billing ord
            BORDR2      PF               14,573,568   Border file extra fie
            BRKAUTH     PF               10,674,176   BROKERAGE AUTHORIZATI
            BT2222      PF                1,933,312   Orders created with B

                            TOTAL     3,524,534,272                      
                            FINAL TOTALS                                       
                            TOTAL    50,994,868,224                            

*******   SYSLISTPF Query   *****




   Query . . . . . . . . . . . . . . . . . SYSLISTPF
     Library . . . . . . . . . . . . . . . OISTST
   Query text  . . . . . . . . . . . . . . List Large SYS Objects
   Query CCSID . . . . . . . . . . . . . . 65535
   Query language id . . . . . . . . . . .
   Query country id  . . . . . . . . . . .
     *** . is the decimal separator character for this query ***
   Collating sequence  . . . . . . . . . . Hexadecimal
   Processing options
     Use rounding  . . . . . . . . . . . . Yes (default)
     Ignore decimal data errors  . . . . . No (default)
     Ignore substitution warnings  . . . . Yes
     Use collating for all compares  . . . No
 Selected files
   ID     File           Library       Member        Record Format
   T01    SYSSIZE        OISTST        *FIRST        QLIDOBJD
 Select record tests
   AND/OR   Field             Test     Value (Field, Numbers, or 'Characters')
            ODOBSZ            GT       1000000
    AND     ODOBAT            NE       'LF'
 Ordering of selected fields
   Field           Sort      Ascending/  Break  Field
   Name            Priority  Descending  Level  Text
   ODLBNM                                1      Library
   ODOBNM                                       Object
   ODOBAT                                       Object attribute
   ODOBSZ                                       Object size
   ODOBTX                                       Text description
   ODOBOW                                       Object owner
                                    IBM Query/400                       1/07/03   10:18:35         Page    2
 Report column formatting and summary functions
   Summary functions:  1-Total, 2-Average, 3-Minimum, 4-Maximum, 5-Count           Overrides
   Field           Summary    Column                                Dec  Null       Dec  Numeric
   Name            Functions  Spacing  Column Headings         Len  Pos  Cap   Len  Pos  Editing
   ODLBNM                     0        Library                  10
   ODOBNM                     2        Object                   10
   ODOBAT                     2        Object                   10
                                       Type
   ODOBSZ          1          0        Object                   10    0
                                       Size
   ODOBTX                     2        Text description         50
   ODOBOW                     2        Object                   10
                                       Owner
 Report breaks
   Break  New   Suppress   Break
   Level  Page  Summaries  Text
   1      No    No
 Selected output attributes
   Output type . . . . . . . . . . . . . . Printer
   Form of output  . . . . . . . . . . . . Detail
   Line wrapping . . . . . . . . . . . . . No
 Printer Output
   Printer device  . . . . . . . . . . . . *PRINT
   Report size
     Length  . . . . . . . . . . . . . . .  68 (default)
     Width . . . . . . . . . . . . . . . . 127
   Report start line . . . . . . . . . . .   2
   Report end line . . . . . . . . . . . .  66
   Report line spacing . . . . . . . . . . Single space
   Print definition  . . . . . . . . . . . No
 Printer Spooled Output
   Spool the output  . . . . . . . . . . . Yes
   Form type . . . . . . . . . . . . . . . 0088
   Copies  . . . . . . . . . . . . . . . .   1
   Hold  . . . . . . . . . . . . . . . . . (Defaults to value in print file, QPQUPRFIL)
                                    IBM Query/400                       1/07/03   10:18:35         Page    3
 Cover Page
   Print cover page  . . . . . . . . . . . No
     Cover page title
 Page headings and footings
   Print standard page heading . . . . . . Yes
     Page heading
     Page footing
       (oistst/syslist)
   * * * * *    E N D   O F   Q U E R Y   P R I N T   * * * * *

Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries CL programming
Taking advantage of CL advancements, starting with V5R3
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help

RPG iSeries programming
Enhancing RPG with external SQL stored procedures
Introduction to SQLRPGLE on IBM i: Making a report
Making the most of RPG data handling on IBM i
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Allow access to data from a stored procedure result set using COBOL or RPG
EGL Rich UI on IBM i: Do you Dojo?
Programming for the Web on the IBM i, what is possible
A taste of COMMON: ILE, IBM releases, Web applications and new products
Documenting nested program structures on the AS/400

iSeries programmer tips
Enhancing RPG with external SQL stored procedures
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
Implementing a browser interface in COBOL: Displaying database fields
Taking advantage of CL advancements, starting with V5R3
TAATOOL: Useful tools for programmers on IBM i
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Making the most of RPG data handling on IBM i
Groovy programming on IBM i

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Report Program Generator  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts