Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2078
  • Last Modified:

Find all programs that use a certain file on an ISeries AS/400

I have a problem with a certain file and need to reference all programs that use this file.  Is there a command or cross reference I can run to locates these programs?
0
Aidenous
Asked:
Aidenous
2 Solutions
 
Gary PattersonVP Technology / Senior Consultant Commented:
The DSPPGMREF command allows you to dump a list of objects referenced by a particular program (or group of programs) to the screen, to a spooled file, or to a database file.  this can be a VERY long running command if you run it over a large set of objects.  I suggest submitting a series of commands, perhaps library by library, rather than doing something like *ALLUSR.  submit the command to batch.

http://publib.boulder.ibm.com/html/as400/v5r1/ic2994/index.htm?info/cl/dsppgmre.htm

If the file has logicals, indexes, or views created over it, remember that you probably need to search the DSPPGMREF output for all of those, too.

Another great tools it to turn on journaling for that database file (or inspect the journal receiver if journaling is already in use).  Journal receivers log the date, time, program, user, job, and details of every change to every record of a journaled file.  Be aware that journal receivers can grow very large on frequently-maintianed files.  the Bacup and Recover manual (or section of the Information Center) can provide more informationon journaling.    

- Gary Patterson
0
 
tliottaCommented:
Aidenous:

Be aware that Gary's reference to journaling might be your only way to locate all references.

File references can be 'symbolic' through the use of variables that hold the actual file names or 'indirect' through the use of logical views or aliases. Overrides (e.g., OVRDBF) can redirect to a file.

And SQL can really interfere.

But a journal will still be notified when the file is accessed, regardless of symbols, indirection, SQL, whatever.

Also, there is database journaling and there is object (audit) journaling. The system audit journal can log object read and object change actions. That is separate from any database journaling, and it logs very different information. The database journal is more focused on the data spaces and what happens to the data. The audit journal is more focused on the object itself rather than its content.

The appropriate methods for locating references to files can depend on the methods used by the developers of the programs. Just be aware that you might need to do some detective work if you need to find everything. Some references can be fairly well obscured.

Gary's got you started with the most likely tool -- DSPPGMREF. If you run into questions, keep asking for more info.

Tom
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
Tom,

I'm glad you brought that up.  As database files are more and more frequently accessed from non-native programs, DSPPGMREF loses more and more of it's value.

Aidenous,

If all you are concerned about are direct references in traditional CL, RPG, and COBOL programs, the DSPPGMREF is very good.

Personally, if I need to track down what program is causing a data problem, I almost always use database journaling, unless it is a file that is only modified in a very few places.   It is fantastic for intermittent problems, or problems caused by client-server applications.  Database journaling catches every single change to the journaled file, even changes to files through system utilities or APIs like interactive SQL, DFU, remote DDM, DRDA, ODBC, etc.
 
- Gary Patterson
0
 
mayankgangradeCommented:
Hi,

Hawkeye PATHFINDER is the most advanced and comprehensive documentation, cross reference, and impact analysis software available for the IBM AS/400.
The package will analyze files, programs, and fields, along with other system or user objects, and place that information on a workstation, printer or in an outfile within seconds. Beyond cross reference, PATHFINDER also contains numerous utilities for managers, operators, programmers, and security officers.

PATHFINDER is designed to allow you to accomplish your development tasks without ever leaving the package.
0
 
larry_diliCommented:
Use Hawkeye is you have. Or DSPPGMREF.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now