24
Tue, Dec
1 New Articles

Fat Folder Finder

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

If your documents and folders are threatening to engulf your disk, our ANZFLRDOC utility makes it easy to find the culprits.

I have always wondered which folders were contributing most to the growing size of my QDOC library. I couldn't find a way to list the documents within folders (including document sizes) until, a few months ago, I saw a program in MC's "TechTalk" that listed the number of documents in first level folders and their relative age.

That article set me to thinking. The result is my Analyze Folder Documents (ANZFLRDOC) command, which prints a list of the total storage used by all documents in QDOC, by folder and/or subfolder. I have included a sample of the report in 1. Storage also includes the space taken by the folder object. All I need to do is run the ANZFLRDOC command (2), which has no parameters. Since the command takes a long time to execute, I always submit it to batch with the Submit Job (SBMJOB) command, as follows:

That article set me to thinking. The result is my Analyze Folder Documents (ANZFLRDOC) command, which prints a list of the total storage used by all documents in QDOC, by folder and/or subfolder. I have included a sample of the report in Figure 1. Storage also includes the space taken by the folder object. All I need to do is run the ANZFLRDOC command (Figure 2), which has no parameters. Since the command takes a long time to execute, I always submit it to batch with the Submit Job (SBMJOB) command, as follows:

 SBMJOB CMD(ANZFLRDOC) + JOB(ANZFLRDOC) 

The ANZFLRDOC command runs CL program FLR002CL (3) which first uses QRYDOCLIB to build a reference file for all objects in QDOC. This provides the system object names as well as the folder and document names. The second step is to use DSPOBJD to build another reference file of all document objects in QDOC, but this file will show the storage size of the objects.

The ANZFLRDOC command runs CL program FLR002CL (Figure 3) which first uses QRYDOCLIB to build a reference file for all objects in QDOC. This provides the system object names as well as the folder and document names. The second step is to use DSPOBJD to build another reference file of all document objects in QDOC, but this file will show the storage size of the objects.

The logical files are used to control report sequence. FLR-002W3 (4a) selects records by name within folder; FLR002W4 (4b) is in name sequence only. The RPG program (6) uses an externally described printer file (5) and ties these two files together to produce the list.

The logical files are used to control report sequence. FLR-002W3 (Figure 4a) selects records by name within folder; FLR002W4 (Figure 4b) is in name sequence only. The RPG program (Figure 6) uses an externally described printer file (Figure 5) and ties these two files together to produce the list.

As coded, the report prints the first 25 characters of the folder's path in its first data column. I chose 25 because it's enough in my installation. If you use the full 63-character folder names, you'll have to modify the definition of printer file FLR002P1.

Finally, I have a report that's concise and simple to understand, which eliminates all guesswork about the contents of QDOC. I think you'll find ANZFLRDOC as useful as I have.


Fat Folder Finder

Figure 1 Sample report

 Figure 1: Sample Report 5/09/92 Analyze Folder Documents Page 1 FLR002RG 7:40:47 Folder Tot Docs 3+Mons 6+Mons 12+Mons 24-Mons Doc Size 18 1 8 1 1,753,088 ADWELL 1 16,384 AL 1 24,576 AMBFAX 13 178,176 AMBLETT 5 1 70,656 AMBMEMO 38 10 595,968 ANDERSON 1 16,384 AS400BKS 165 136 148,795,392 BARBARA 14 1 10 258,560 BARRY/FAX 11 3 4 1 178,176 BARRY/LETTERS 28 1 8 17 448,512 BARRY/MEMOS 30 4 9 13 521,728 BARRY/REPORTS 51 3 12 28 1,155,584 BELA 1 24,576 BELA/AGENDAS 5 1 81,920 BELA/ANNOUNCE 8 2 114,688 BELA/FAX 49 7 819,200 ///////////////////////////////////////////////////////////////////////////// TIPTON 4 2 59,392 TODD 2 24,576 TONY/FAX 17 4 13 235,520 TONY/ITINERAR 2 2 27,136 TONY/LETTERS 25 1 19 357,376 TONY/MEMOS 55 1 5 31 896,000 TONY/REPORTS 24 1 16 712,192 TONYB/LETTERS 1 1 16,384 TONYB/MEMOS 1 1 16,384 TQMLEAD 3 40,960 TQMLIST 1 12,288 TQMTEAMS 1 16,384 TRACY 4 3 57,856 14867 1294 3405 4926 2470 453,214,720 
Fat Folder Finder

Figure 2 Command ANZFLRDOC

 ANZFLRDOC: CMD PROMPT('Analyze Folder Documents') 
Fat Folder Finder

Figure 3 CL program FLR002CL

 FLR002CL: PGM CLRPFM FILE(FLR002W1) CLRPFM FILE(FLR002W2) /* Build documnets by folder reference file */ QRYDOCLIB OUTFILE(FLR002W1) OUTDTATYP(*CHGDATE) + /* format: QAOSIQDL in QSYS, record code + 130 for date last changed */ /* Build document size reference file */ DSPOBJD OBJ(QDOC/*ALL) OBJTYPE(*DOC) + OUTPUT(*OUTFILE) OUTFILE(FLR002W2) + /* format QLIDOBJD */ CALL PGM(FLR002RG) /* print report */ CLRPFM FILE(FLR002W1) CLRPFM FILE(FLR002W2) END: ENDPGM 
Fat Folder Finder

Figure 4A Logical file FLR002W3

 A R OSQDL PFILE(FLR002W1) A K QDLFLR A K QDLDNM 
Fat Folder Finder

Figure 4B Logical file FLR002W4

 A R QLIDOBJD PFILE(FLR002W2) A K ODOBNM 
Fat Folder Finder

Figure 5 Printer file FLR002P1

 A R HDG001 A SKIPB(004) A SPACEA(002) A 1 A SPACEB(001) A DATE A EDTCDE(Y) A +22 A DFT('Analyze Folder Documents') A +23 A DFT('Page') A +1 A PAGNBR A EDTCDE(Z) A 1 A DFT('AFD001RG') A SPACEB(001) A +2 A TIME A 1 A DFT('folder') A SPACEB(002) A +19 A DFT('tot-docs') A +3 A DFT('3+mons') A +3 A DFT('6+mons') A +2 A DFT('12+mons') A +2 A DFT('24-mons') A +9 A DFT('doc-size') A R TOTL1 A SPACEA(001) A FLNAM 25A O 1 A CURTOT 4S 0O +4 A EDTCDE(Z) A CTR3 4S 0O +5 A EDTCDE(Z) A CTR6 4S 0O +5 A EDTCDE(Z) A CTR12 4S 0O +5 A EDTCDE(Z) A CTR24 4S 0O +5 A EDTCDE(Z) A FLSZ 10S 0O +4 A EDTCDE(2) A R TOTLR A SPACEA(001) A SPACEB(002) A TOTDOC 5S 0O 29 A EDTCDE(Z) A CTR3T 5S 0O +4 A EDTCDE(Z) A CTR6T 5S 0O +4 A EDTCDE(Z) A CTR12T 5S 0O +4 A EDTCDE(Z) A CTR24T 5S 0O +4 A EDTCDE(Z) A FLSZT 12S 0O +2 A EDTCDE(2) 
Fat Folder Finder

Figure 6 RPG program FLR002RG

 FFLR002W3IP E K DISK FFLR002W4IF E K DISK FFLR002P1O E 66 PRINTER * IOSQDL I QDLFLRL1 * IQDLDTA IDS I 3 40FLYR I 5 60FLMO I 7 80FLDAY C *IN90 IFEQ *OFF * Set up number of months in current date C UYEAR MULT 12 NOWMON 40 C ADD UMONTH NOWMON C MOVEL*ON *IN90 C WRITEHDG001 C MOVEL*OFF *IN66 C END C MOVELQDLFLR FLNAM * Get file size record C QDLONM CHAINQLIDOBJD 31 C ADD ODOBSZ FLSZ C ADD ODOBSZ FLSZT * Compute number of months age of document C FLYR MULT 12 MONS 40 C ADD FLMO MONS C NOWMON SUB MONS TMONS 40 * C TMONS IFGT 24 C ADD 1 CTR24 C ADD 1 CTR24T C GOTO END C END C TMONS IFGT 12 C ADD 1 CTR12 C ADD 1 CTR12T C GOTO END C END * C TMONS IFGT 6 C ADD 1 CTR6 C ADD 1 CTR6T C GOTO END C END * C TMONS IFGT 3 C ADD 1 CTR3 C ADD 1 CTR3T C GOTO END C END * C END TAG C ADD 1 CURTOT C ADD 1 TOTDOC * CL1 *IN66 IFEQ *ON CL1 WRITEHDG001 CL1 MOVEL*OFF *IN66 CL1 ENDIF CL1 WRITETOTL1 CL1 CLEARTOTL1 CLR WRITETOTLR 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: