5 pts.
 Display only the PFs and the number of records in each PF, from a library
Get the library name from a different user , accept the library name , then send the list of only the Physical files in that library , along with the number of records in each PF , to that user.

Software/Hardware used:
ASKED: February 3, 2009  6:45 AM
UPDATED: February 4, 2009  12:33 PM

Answer Wiki:
Hi, You can use DSPFD to an output file to get these details. Regards, Martin Gilbert.
Last Wiki Answer Submitted:  February 3, 2009  9:54 am  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

There is a fast way to do this.

In the QSYS library there is a bunch of system files beginning QADB*.

These files are maintained by the system and must only be opened for read-only.

The file QADBXREF contains a list of ALL the physical and logical files on the system, and SQL views and indices, in all libraries. You can write a query or SQL to extract the information you want.

The fields in this file are:

DBXFIL     File name                                         
DBXLIB     Library name                                      
DBXDIC     Dictionary name                                   
DBXOWN     User profile name of owner                        
DBXTXT     File text                                         
DBXATR     PF-physical,LF-logical,TB-table,VW-view,IX-index  
DBXLNK     E-ext described, P-pgm described, Blank-no link   
DBXSQL     I-IDDU,S-SQL,C-CRTDTADCT,X-migration,Blank-no link
DBXTYP     D-data file, S-source file                        
DBXNFL     Maximum number of fields                          
DBXNKF     Maximum number of key fields                      
DBXRDL     Maximum record length                             
DBXIDV     Dictionary internal file definition ID            
DBXREL     Relational file: Y=Yes,N=No                       
DBXLFI     Long file name                                    
DBXLFQ     Long file name is quoted                          
DBXWCO     C-CASCADED, Y-Yes (local), N-No                   
DBXUPD     Y-Yes, N-No                                       
DBXUNQ     D-No, V-Yes (allow NULL duplicates), U-Yes, E-EVAP
DBXREM     Long file description                             
DBXDFN     SQL VIEW definition                               
DBXATS     File change timestamp                             
DBXLB2     Library name                                      
DBXADB     Alias Relational Database name                    
DBXALB     Alias Library name                                
DBXAFL     Alias File name                                   
DBXAMB     Alias Member name                                 
DBXINSERT  Y-Yes N-No                                        
DBX_PASP   Primary ASP                                       
DBXSO      Y-S/O logical, D-DYNSLT, N-Not S/O Logical        
DBXSYS     Y-System File                                     
DBXPART    Number Of Partitions                              
DBXISPAN   INDEX OVER PARTITIONED TBL SPANS ALL MEMBERS      
DBXDELETE  Y - YES, N - NO
DBXDEFINER Definer        

The keys to the file are DBXLIB, DBXFIL.

There are a number of logicals over this file, which will give you different views of the data. Some of these logicals are in QSYS, others in QSYS2, and yet others in SYSIBM. If you access the data using SQL, don’t use the logicals!

Regards,

Sloopy

 2,195 pts.