Skip to content

Instantly share code, notes, and snippets.

@BirgittaHauser
Created November 20, 2020 09:40
Show Gist options
  • Save BirgittaHauser/db87e394369e2efdf4d3ce2ab751fe2a to your computer and use it in GitHub Desktop.
Save BirgittaHauser/db87e394369e2efdf4d3ce2ab751fe2a to your computer and use it in GitHub Desktop.
Determine the Source Member for DDS describe physical and logical files
-- Parameters for Object_Statistics:
-- 1. OBJECT_SCHEMA: Library where the DDS described database object is located
-- Special Values: *ALL, *ALLAVL, *ALLSIMPLE, *ALLUSR, *ALLUSRAVL, *CURLIB, *LIBL, *USRLIBL
-- 2. OBJECT_TYPE_LIST: List Object Types
-- Special Values: *ALL
-- 3. OBJECT_NAME: Name of the DDS described physical or logical file
-- Special Values: *ALL
Select X.ObjName, X.ObjLib,
x.Source_File, x.Source_Library, x.Source_Member
From Table(qsys2.object_statistics(OBJECT_SCHEMA => 'YOURSCHEMA',
OBJTYPELIST => '*ALL',
OBJECT_NAME => '*ALL')) x
join SysTables on x.ObjName = System_Table_Name
and x.ObjLib = System_Table_Schema
Where TABLE_TYPE in ('P', 'L') -- DDS physical and logical files
and FILE_TYPE = 'D';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment