|
(Note the subject line change) Some years ago I found a RTVQRYF routine on the News/400 freeware/shareware site that will extract a list of files used by Queries. It is in the public domain so I have included the RPG code here. It won't change the files names for you but at least you can identify all the queries that you might decide to manually change. Bill --------------------------------------- *================================================================ * This program creates MI program RTVQRYF in library QGPL. The = * program can be moved from library QGPL to any library you = * choose = * = * The source statements for the MI program are found in array = * MI. Look at comments in the MI source for information on the = * parameters you need to pass when calling the RTVQRYF utility. = *================================================================ E MI 1 285 80 I DS I B 1 40#SRCLN I I 'RTVQRYF QGPL' 5 24 #PGMLB I 25 74 #TEXT I I 'QMISRC QGPL' 75 94 #SRCFL I I 'RTVQRYF' 95 104 #MBR I 105 117 #CHGDT I 105 105 #CENT I 106 107 #YY I 108 111 #MMDD I 112 117 #HMS I 118 137 #PRTFL I B 138 1410#STRPG I 142 151 #AUT I 152 327 #OP I B 328 3310#NOOPT I DS I 1 120TIMDAT I 1 6 HHMMSS I 7 10 MMDD I 11 12 YY C TIME TIMDAT C MOVE '0' #CENT C MOVE YY #YY C MOVE MMDD #MMDD C MOVE HHMMSS #HMS C CALL 'QPRCRTPG' C PARM MI C PARM 21920 #SRCLN C PARM #PGMLB C PARM ' ' #TEXT C PARM #SRCFL C PARM #MBR C PARM #CHGDT C PARM ' ' #PRTFL C PARM 0 #STRPG C PARM '*USE' #AUT C PARM ' ' #OP C PARM 0 #NOOPT C MOVE *ON *INLR ** /*===================================================================*/ /* Program....... RTVQRYF */ /* Description... Retrieve list of files used by query */ /* --------------------------------------------------------------- */ /* Parameter description Type Length */ /* */ /* Query name (required) Character 10 */ /* Library containing query (Name required) Character 10 */ /* Input file list structure Character 1280 */ /* */ /* The 1280 byte file list structure is used */ /* to return the list of files used as input to */ /* the query. The strucure is a 32 element */ /* array of 40 bytes. The format is a 10 byte */ /* file name, 10 byte library name, 10 byte */ /* member name and 10 byte record format name. */ /* The member name could be returned as special */ /* value *FIRST, in which case you must */ /* retrieve specific member name information */ /* if needed. */ /* */ /* Output file structure Character 30 */ /* */ /* The 30 byte output file structure is used */ /* to return the output file of the query. */ /* The format is a 10 byte file name, 10 byte */ /* library name and 10 byte member name. The */ /* member name could be returned as special */ /* value *FIRST or *FILE, in which case you */ /* must retrieve the specific member name */ /* information if needed. If the query does */ /* not produce an output file, special value */ /* *NONE will be returned at the beginning */ /* of the structure. If the output file is */ /* the default QQRYOUT, special value *DFT */ /* will be returned at the beginning of */ /* the structure. */ /* */ /* Return code (0=Normal, 1=Abend) Character 1 */ /*===================================================================*/ ENTRY *(ENTRY_PLIST) EXT ; /*===================================================================*/ /* Entry parameters */ /*===================================================================*/ DCL SPCPTR Query@ PARM ; DCL DD Query CHAR(10) BAS(Query@) ; DCL SPCPTR Query_Library@ PARM ; DCL DD Query_Library CHAR(10) BAS(Query_Library@) ; DCL SPCPTR Query_Input_Files@ PARM ; DCL DD Query_Input_Files CHAR(1280) BAS(Query_Input_Files@) ; DCL SPCPTR Query_Output_File@ PARM ; DCL DD Query_Output_File CHAR(30) BAS(Query_Output_File@) ; DCL SPCPTR Return_Code@ PARM ; DCL DD Return_Code CHAR(1) BAS(Return_Code@) ; DCL OL ENTRY_PLIST(Query@, Query_Library@, Query_Input_Files@, Query_Output_File@, Return_Code@) PARM EXT MIN(5) ; /*===================================================================*/ /* System pointers for library and query definition */ /*===================================================================*/ DCL SYSPTR Library# ; DCL SYSPTR Query# ; /*===================================================================*/ /* Query definition data */ /*===================================================================*/ DCL SPCPTR Query_Data@ ; DCL SPCPTR Query_Number_Input_Files@ ; DCL DD Query_Number_Input_Files BIN(2) BAS(Query_Number_Input_Files@) ; /*===================================================================*/ /* Template for system pointer resolution */ /*===================================================================*/ DCL DD Object CHAR(34) ; DCL DD Object_Type CHAR(2) DEF(Object) POS(1) ; DCL DD Object_Name CHAR(30) DEF(Object) POS(3) ; DCL DD Object_Authority CHAR(2) DEF(Object) POS(33) INIT(X'0000') ; /*===================================================================*/ /* Template for query definition input file */ /*===================================================================*/ DCL SPCPTR Query_Input_Files_Template@ ; DCL DD Query_Input_Files_Template CHAR(80) BAS(Query_Input_Files_Template@) ; DCL DD Query_Input_Files_Template_File_Name CHAR(10) DEF(Query_Input_Files_Template) POS(3) ; DCL DD Query_Input_Files_Template_Library_Name CHAR(10) DEF(Query_Input_Files_Template) POS(15) ; DCL DD Query_Input_Files_Template_Member_Name CHAR(10) DEF(Query_Input_Files_Template) POS(27) ; DCL DD Query_Input_Files_Template_Format_Name CHAR(10) DEF(Query_Input_Files_Template) POS(39) ; /*===================================================================*/ /* Template for query definition output file */ /*===================================================================*/ DCL SPCPTR Query_Output_File_Template@ ; DCL DD Query_Output_File_Template CHAR(112) BAS(Query_Output_File_Template@) ; DCL DD Query_Output_File_Template_File_Name CHAR(10) DEF(Query_Output_File_Template) POS(5) ; DCL DD Query_Output_File_Template_Library_Name CHAR(10) DEF(Query_Output_File_Template) POS(17) ; DCL DD Query_Output_File_Template_Member_Name CHAR(10) DEF(Query_Output_File_Template) POS(29) ; /*===================================================================*/ /* Work variables */ /*===================================================================*/ DCL DD Next_File_Offset BIN(2) AUTO ; DCL DD Query_Number_Input_Files_Work BIN(2) ; DCL SPCPTR Query_Data_Offset@ ; DCL DD Query_Data_Offset BIN(4) BAS(Query_Data_Offset@) ; DCL SPCPTR Query_Output_Type@ ; DCL DD Query_Output_Type CHAR(1) BAS(Query_Output_Type@) ; /*===================================================================*/ /* Exception monitor */ /*===================================================================*/ DCL EXCM * EXCID(H'0000') BP(.Exit) ; /*===================================================================*/ /* Default to error condition */ /*===================================================================*/ CPYBLA Return_Code,'1' ; /*===================================================================*/ /* Initialize input files structure to blanks */ /*===================================================================*/ CPYBREP Query_Input_Files,' ' ; /*===================================================================*/ /* Initialize output file name to blanks */ /*===================================================================*/ CPYBREP Query_Output_File,' ' ; /*===================================================================*/ /* Resolve pointer to library */ /*===================================================================*/ CPYBLA Object_Type,X'0401' ; CPYBLAP Object_Name,Query_Library,' ' ; RSLVSP Library#,Object,*,* ; /*===================================================================*/ /* Resolve pointer to query definition */ /*===================================================================*/ CPYBLA Object_Type,X'1911' ; CPYBLAP Object_Name,Query,' ' ; RSLVSP Query#,Object,Library#,* ; /*===================================================================*/ /* Point to beginning of associated space for query definition */ /*===================================================================*/ SETSPPFP Query_Data@,Query# ; /*===================================================================*/ /* Check for output file */ /*===================================================================*/ SETSPPO Query_Data@,260 ; CPYBWP Query_Output_Type@,Query_Data@ ; CMPBLA(B) Query_Output_Type,'3'/NEQ(.No_Output_File) ; /*===================================================================*/ /* Retrieve offset to output file */ /*===================================================================*/ SETSPPO Query_Data@,380 ; /*===================================================================*/ /* Point to beginning of output file template area */ /*===================================================================*/ CPYBWP Query_Data_Offset@,Query_Data@ ; CMPBLA(B) Query_Data_Offset, X'00000000'/EQ(.Dft_Output_File) ; SETSPPO Query_Data@,Query_Data_Offset ; CPYBWP Query_Output_File_Template@,Query_Data@ ; CPYBLA Query_Output_File(1:10), Query_Output_File_Template_File_Name ; CPYBLA Query_Output_File(11:10), Query_Output_File_Template_Library_Name ; CPYBLA Query_Output_File(21:10), Query_Output_File_Template_Member_Name ; B .Get_Input_Files ; /*===================================================================*/ /* Query does not have an outfile */ /*===================================================================*/ .No_Output_File: ; CPYBLA Query_Output_File,'*NONE' ; B .Get_Input_Files ; /*===================================================================*/ /* Query uses default outfile */ /*===================================================================*/ .Dft_Output_File: ; CPYBLA Query_Output_File,'*DFT' ; /*===================================================================*/ /* Retrieve offset to number of files used as input to query */ /*===================================================================*/ .Get_Input_Files: ; SETSPPO Query_Data@,558 ; /*===================================================================*/ /* Retrieve number of files used as input to query */ /*===================================================================*/ CPYBWP Query_Number_Input_Files@,Query_Data@ ; CPYNV Query_Number_Input_Files_Work, Query_Number_Input_Files ; /*===================================================================*/ /* Point to beginning of input file list */ /*===================================================================*/ SETSPPO Query_Data@,560 ; /*===================================================================*/ /* Loop through list of input files */ /*===================================================================*/ CPYNV Next_File_Offset,1 ; .Loop01: ; CMPNV(B) Query_Number_Input_Files_Work,0/EQ(.End01) ; CPYBWP Query_Input_Files_Template@,Query_Data@ ; CPYBLA Query_Input_Files(Next_File_Offset:10), Query_Input_Files_Template_File_Name ; ADDN(S) Next_File_Offset,10 ; CPYBLA Query_Input_Files(Next_File_Offset:10), Query_Input_Files_Template_Library_Name ; ADDN(S) Next_File_Offset,10 ; CPYBLA Query_Input_Files(Next_File_Offset:10), Query_Input_Files_Template_Member_Name ; ADDN(S) Next_File_Offset,10 ; CPYBLA Query_Input_Files(Next_File_Offset:10), Query_Input_Files_Template_Format_Name ; ADDN(S) Next_File_Offset,10 ; SUBN(S) Query_Number_Input_Files_Work,1 ; ADDSPP Query_Data@,Query_Data@,80 ; B .Loop01 ; .End01: ; /*===================================================================*/ /* Set normal return code */ /*===================================================================*/ CPYBLA Return_Code,'0' ; .Exit: ; DEACTPG * ; RTX * ; /*===================================================================*/ /* End of program return */ /*===================================================================*/ /*'/*'/*"/*"*/; PEND;;; -- NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected.
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.