Can you help this iSeries user? He wants to know how he can find only source physical files in any library (Ex: QDDSSRC, QCLSRC, etc.).
Thanks!
Michelle Davidson
Editor
Search400.com
Software/Hardware used:
ASKED:
August 16, 2005 10:20 AM
UPDATED:
January 20, 2011 5:28 AM
The PDM option is best if you want to find a source member so you can change it. If you just want a list of where the files are you can do the following:
DSPFD FILE(library to check/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) OUTFILE(library/file to hold output)
If the field ATFILA = *PHY and field ATDTAT = S it is a source physical file.
You can use the outfile created from the command in a query, RPG, or CL program.
In QSYS library there is a file named QADBXREF that contains a record for every DB file on the system. There are codes on the file that say whether the file is an LF or PF and if a PF whether it is a data or source file. To get a list of source files, in SQL execute the following:
SELECT * FROM qadbxref WHERE DBXATR = ‘PF’ and
DBXTYP = ‘S’
This will get you a list of all source physical files on your iSeries. If you want just those in a particular library add selection to your WHERE.
You can also use the Display Object Description command to locate Source Physical Files:
DSPOBJD OBJ(*ALL/*ALL)
OBJTYPE(*FILE)
OUTPUT(*OUTFILE)
OUTFILE(YOURLIB/DSPOBJDFLE)
then use WRKQRY if you have it to query the file for PF-SRC files.
DSPOBJD finds all physical files in a library with an object type of *FILE and an object attribute of PF. Both source and physical data files are tagged this way. So unless your shop only uses Q* default names for source files and follows the IBM recommendation that you don’t name any user objects starting with Q, I don’t see how a DSPOBJD will find only source files.
File QADBXREF is built by the operating system and is constantly updated as new files are added, changed or deleted. And the data on this file knows the difference between a data or source PF.
Note that file QSYS/QADBXREF is a physical system file that is in constant use by DB2 itself and technically should not be accessed directly. Unusual interruptions of system activity against this file can be troublesome causes of database catalog inconsistencies. The RCLSTG SELECT(*DBXREF) can help correct such inconsistencies, but database operation is somewhat unpredictable until corrections are done.
It is better to use any of the logical files and SQL views that IBM has provided to review the info. For example, logical file QADBXATR provides field DBXTYP to expose ‘D’=Data or ‘S’=Source physical file.
A full list of LFs/views can be seen from DSPDBR QADBXREF.
Tom
HOW TO CHANGE THE ATTRIBUTES OF A PF WITHOUT LOOSING THE DATA
HOW TO CHANGE THE ATTRIBUTES…
Can you explain how this relates to finding source files? If not, then you will be better off opening your own question. When you open your question, you need to include a list of “attributes” that you want to change.
Tom