| 
 | 
I want to build a file of containing the file sizes of each PF and each journal file on our AS/400. To build this, I need to run DSPFD to an outfile for the PF's, and DSPOBJD to a different outfile for the *JRNRCV files.
Since I want only one pgm to process the outfile, I used OPNQRYF to make the DSPOBJD outfile look like the DSPFD file, and add the journal records to the end.
Is there a better way to do this? I had to map many fields to blanks and zeros. Isnt there a way to build a record format in OPNQRYF and use blanks and zeros to fill any fields missing in the input file? This turns a simply OPNQRYF stmt into an ugly mess!
Any better ideas? Thanks!
CL code:
            DSPFD      FILE(*ALL/*ALL) TYPE(*MBRLIST) +               
                         OUTPUT(*OUTFILE) OUTFILE(SUPPORTLIB/FDSKHSTW)
                                                                      
            CLOF DSPOBJDOUT                                           
            DSPOBJD    OBJ(*ALL/*ALL) OBJTYPE(*JRNRCV) +              
                         OUTPUT(*OUTFILE) OUTFILE(QTEMP/DSPOBJDOUT)   
            OVRDBF     FILE(DSPOBJDOUT) TOFILE(QTEMP/DSPOBJDOUT) +    
                         SHARE(*YES)                                  
            OPNQRYF    FILE((DSPOBJDOUT)) FORMAT(FDSKHSTW) +          
                         MAPFLD((MLFILE ODOBNM) (MLLIB ODLBNM) +      
                         (MLSIZE ODOBSZ) (MLCDAT '%SST(ODCDAT 5 2) +  
                         *cat %sst(odcdat 1 4)') (MLUDAT +            
                         '%SST(ODUDAT 5 2) *cat %sst(odUdat 1 4)') +  
                         (MLCHGD '%SST(ODLDAT 5 2) *cat +             
                         %sst(odLdat 1 4)') (MLMTXT ODOBTX) +         
                         (MLNAME '" "') (MLNRCD 0) (MLNDTR 0) +       
                         (MLRCEN '" "') (MLRDAT '" "') (MLRTIM '" +   
                         "') (MLFTYP '" "') (MLFILA '" "') (MLMXD +   
                         '" "') (MLFATR '" "') (MLSYSN '" "') +       
                         (MLASP 0) (MLRES '" "') (MLNOMB 0) (MLSEU +  
                          '" "') (MLCCEN '" "') (MLCHGC '" "') +
                          (MLCHGT '" "') (MLSEU2 '" "') (MLUCEN 
                          "') (MLUCNT 0) (MLTCEN '" "') (MLTDAT 
                          "') (MLSIZ2 0) (MLSTFR '" "'))        
             CPYFRMQRYF FROMOPNID(DSPOBJDOUT) TOFILE(FDSKHSTW) +
                          MBROPT(*ADD) FMTOPT(*MAP)             
                          CLOF DSPOBJDOUT                       
             CLOF DSPOBJDOUT                                    
                                                                
             CALL       PGM(pgma)     /* process PFsize records and journal size records.  */
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.