|
Steven,
Here is a small CL that we use for this.
/**********************************************************************/
/* C O P Y R I G H T -
*/
/* HANOVER WIRE CLOTH
*/
/**********************************************************************/
/* DO NOT COPY OR DISTRIBUTE WITH OUT PERMISSION
*/
/**********************************************************************/
/*
*/
/* PROGRAM: ANZQRYBLD
*/
/* PURPOSE: Build work file for query analysis
*/
/* AUTHOR: Mark Walter
*/
/* DATE: 06/27/00
*/
/*
*/
/**********************************************************************/
/* *** MODIFICATION LOG ***
*/
/* NAME/CO. DATE DESCRIPTION
*/
/* -------------------- -------- ---------------------------------
*/
/*
*/
/*
*/
/**********************************************************************/
/* program to build the analyze query work file(s)
*/
/* program will create a source physical file in the specified
*/
/* library then add a member for each query to be analyzed
*/
/* Utilize PDM option 25 (SCAN) to search the query
*/
/**********************************************************************/
pgm parm(&lib)
dclf file(qgpl/qryfilewk)
dcl var(&lib) type(*char) len(10)
dcl var(&mbr) type(*Char) len(10)
/* put all query definitions into a temporary work file in QGPL */
/* This file has to be there for the program to compile */
dspobjd obj(&lib/*all) objtype(*qrydfn) output(*outfile) +
outfile(qgpl/qryfilewk) outmbr(*first *replace)
/* does the source physical file exist? */
/* if it doesn't, create it. */
chkobj obj(&lib/qrysource) objtype(*file)
monmsg msgid(cpf9801) exec(crtsrcpf file(&lib/qrysource))
/* if it does exist, remove all of the members */
rmvm file(&lib/qrysource) mbr(*all)
monmsg msgid(cpf7301)
/* file read loop */
read:
rcvf rcdfmt(qlidobjd)
monmsg msgid(cpf0864) exec(goto cmdlbl(eof))
/* add the member to the source file and retrive the query */
/* definition into the member you just added. */
addpfm file(&lib/qrysource) mbr(&odobnm)
rtvqmqry qmqry(&lib/&odobnm) srcfile(&lib/qrysource) +
srcmbr(&odobnm) alwqrydfn(*yes)
goto cmdlbl(read)
eof:
endpgm
Good Luck,
Mark
Mark Walter
Sr. Programmer/Analyst
Hanover Wire Cloth a div of CCX, Inc.
mwalter@hanoverwire.com
http://www.hanoverwire.com
717.637.3795 Ext.3040
STEVEN.J.RYAN@denso
.com.au To: MIDRANGE-L@midrange.com
Sent by: cc:
midrange-l-admin@mi Subject: Files used by Query
drange.com
10/15/01 03:51 AM
Please respond to
midrange-l
Is there any function/command etc. that will let me find out what files are
used
by each Query in a library. I know I can use option 5 (Display) or 6
(Print
definition) on each query in turn, but what I want is something that will
cover
multiple queries simultaneously, and hopefully output to an *OUTFILE.
Thanks
Steven Ryan
_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.