Solved

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

Posted on 2009-04-09
5
1,303 Views
Last Modified: 2013-12-06
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
Comment
Question by:Aidenous
5 Comments
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 250 total points
ID: 24108301
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
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 250 total points
ID: 24112243
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
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 24112361
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
 
LVL 1

Expert Comment

by:mayankgangrade
ID: 24221727
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
 

Expert Comment

by:larry_dili
ID: 24337300
Use Hawkeye is you have. Or DSPPGMREF.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now