I'm sure I don't have the terminology right. I've been given a list of physical files that need to be "moved" out of one journal and into a new journal. Also, the access paths for all files are journaled as well. In my test environment, I ran into this scenario:
PF FILE1 is in the "list"
FILE1L1 is a LF on FILE1; FILE1L1's access path needs to be moved to the new journal.
FILE1J2 is a Join logical file that joins PF FILE1 and PF FILE2; FILE2 and the access path for FILE1J2 need to be moved to the new journal.
FILE2J3 is a Join logical file that joins PF FILE2 and PF FILE3; FILE3 and the access path for FILE2J3 need to be moved to the new journal.
Therefore, given PF FILE1, I want an SQL query that will return:
LF FILE1L1
LF FILE1J2
PF FILE2
LF FILE2J3
PF FILE3
Can this be done?
I found the RELATED_OBJECTS table function in the docs, and there was an example "List all the objects that are dependent on the ORDERS file in APPLIB. For each object, return how many recursive steps were required to find the object."
SELECT LEVEL, RO.*
FROM (VALUES('APPLIB', 'ORDERS')) I(IN_LIB, IN_FILE),
TABLE (QSYS2.OBJECT_STATISTICS(IN_LIB, '*FILE', IN_FILE)),
TABLE(SYSTOOLS.RELATED_OBJECTS(IN_LIB, IN_FILE)) RO
START WITH SOURCE_SCHEMA_NAME = OBJLONGSCHEMA AND
SOURCE_SQL_NAME = OBJLONGNAME
CONNECT BY SOURCE_SQL_NAME = PRIOR SQL_NAME AND
SOURCE_SCHEMA_NAME = PRIOR SCHEMA_NAME
ORDER BY 1, 2, 3;
This query is a bit over my head. When I substituted my library for APPLIB and my "FILE1" for ORDERS, I got all the logicals for FILE1, but not FILE2 nor FILE3. I guess, by definition, neither FILE2 nor FILE3 are dependent on FILE1.
Any ideas would be appreciated.
*** CONFIDENTIALITY NOTICE: The information contained in this communication may be confidential, and is intended only for the use of the recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. ***
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.