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