Wednesday, August 03, 2005

List all queries in AS400

I recently need list all queries in AS400 and get the definistion of the query.

To do that,
First, run following command,

DSPOBJD OBJ(*ALLUSR/*ALL) OBJTYPE(*QRYDFN) OUTPUT(*OUTFILE)
OUTFILE(WZJLIB/QRYLIST)

Second, for each query in the file, run following command to retrive the definition,

RTVQMQRY QMQRY(&ODLBNM/&ODOBNM) SRCFILE(WZJLIB/QUERIES) ALWQRYDFN(*YES)

the full CL program is named as LISTQUERY.

No comments: