The file “QADBXREF” contain all files present in your AS400. In that file, there is a field named “DBXTYP” who will contain the type of file D for data file or S for source file.
Be shure that you have proper security priviledge to access the data of this file.
In SQL (STRSQL) …
SELECT * FROM QSYS/QADBXREF where DBXTYP = ‘S’
… and dump it into a work file.
If at all possible, do not reference QADBXREF directly. This is a physical file that is used by DB2 itself and locks should be avoided.
IBM has provided numerous views into the database catalog. Use those instead. For source files, consider this alternative:<pre>
select * from systables where FILE_TYPE = ‘S’</pre>
It should provide the same rows, but DB2 has control interactions a little better. It might save you from needing a RCLSTG *DBXREF someday.