Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm a bit rusty on my AS400-Fu... never really used it much honestly.

I have a report (or 5) on a system that I have access too... how would I go about locating said report(s) and more detailed information about them.

I'm not sure how the reports are generated (RPG, SQL, etc), but I have the name of the report and some other basic information.

I need to find the report so I can research the information and logic that creates it. From the database/table it pulls info from. To the selection criteria.

On windows and Linux I'd use stuff like find, search, file extension, file explorer, etc to find the file and get information about the file and associated processes and go from there. Can't seem to put my finger on search button for the AS400.

Edit: Ideas from below:


wrkobj *ALL/PBRP581* *PGM

Object      Type      Library     Attribute   Text                       
PBRP581     *PGM      FCSOLIB     RPGLE       Outsourcing - Acct Placement


Program PBRP581 in library FCSOLIBD not found.
share|improve this question
What is it you have - a printed report, a spooled file, or something else? –  Ben Pilbrow Sep 10 '10 at 16:16
printed reports mainly. Trying to follow the chain from there. Report named PBRP581-001 for example. –  WernerCD Sep 10 '10 at 20:51

2 Answers 2

up vote 2 down vote accepted

To locate a program object for this report try the command WRKOBJ *ALL/PBRP581* *PGM.

Once you locate the program object you can find more detailed information using the command DSPPGM library/program. It will identify the type of program as well as the location of the source code for an OPM (old) program:

Program attribute . . : RPG

Type of program  . . . . . . . . . . . . . . . . :   OPM
Source file  . . . . . . . . . . . . . . . . . . :   QPGMSRC 
Library  . . . . . . . . . . . . . . . . . . . :     TEST1 
Source member  . . . . . . . . . . . . . . . . . :   BATITEM1

To view/edit the source code use STRSEU SRCFILE(TEST1/QPGMSRC) SRCMBR(BATITEM).

If the program is a modern ILE program you will have to hunt for the source code. Standard source file names are QRPGSRC, QRPGLESRC, QCBLSRC etc. You can search for source files in all libraries with the command DSPOBJD *ALL/QRPGSRC *FILE.

Use WRKMBRPDM FILE(library/sourcefile) to view all of the source members within a source file.

share|improve this answer
See above for edits... Could it be because it's RPGLE and not an RPG? –  WernerCD Sep 13 '10 at 13:54
You specified FCSOLIBD when the library is clearly FCSOLIB. See if there are any source files in that library with DSPOBJD FCSOLIB/Q* *FILE. –  JamesA Sep 13 '10 at 14:54
Any progress? The question is still open. –  JamesA Sep 16 '10 at 2:31
If you can't find the source, you can try DSPPGMREF. It won't be nearly as helpful, but it could tell you the physical files that the program uses. –  Tracy Probst Sep 16 '10 at 18:42

If you've got a printed query, it's probably generated by a call to RUNQRY QRY(YOURLIB/YOURQRY) somewhere.

Try going into WRKQRY and then in the Library field, put *LIBL, then in the Query field, put PBRP581* and do F4. This should list all queries beginning with PBRP581.

If that brings back the queries you are after, then do a 5 by the query to view the query definition.

share|improve this answer
From above, I think I have an RPGLE, not a query. But using wrkqry + *LIBL, it does show me some stuff I might find usefull in other research areas –  WernerCD Sep 13 '10 at 13:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.