Need to find everyplace a file is being used.

385 pts.
I have a file that we are adding a field. Need to find every program the file is being used to know which ones need to be recompiler. Would be nice to do one big search of the entire library. 

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

DSPPGMREF will get the F specs but…
Not SQL uses and I’m not sure about External Data structures.
For those you will have to Scan the Source code.


Use the DSPPGMREF command specifying *ALL programs in a library to an outfile. Then run a query on the outfile with the following selection criteria and press Enter.

WHFNAM EQ ‘Filename’

The output dislplays all the programs that are using the particular file.

Discuss This Question: 9  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    In general, if you build a list of programs, you can run DSPPGMREF against each program on the list to output file references into a file of references. You can then select those that name your file as was noted above. However, you might also want to review any logical files that are built over the file you're changing. Depending on how those LFs are defined and on how you add the field to the physical file, you might also need to recompile the LFs and recompile programs that use those LFs. Maybe. You can probably ignore SQL references... unless you had some very inexperienced SQL developers. The SQL shouldn't be affected. How much detail do you need? Tom
    125,585 pointsBadges:
  • RonKoontz
    Fir a quickie just go to the library source you are looking at and do an option 25 then F11. Press enter and type the string you are looking for.
    1,810 pointsBadges:
  • reg is where you can go to get a complete package to enable you to have this info at your fingertips at all times. Works great and is a stand alone package.
    280 pointsBadges:
  • Teandy
    You may need to hit F13 (shift + F1) after entering 25 on the option field and before hitting enter.
    5,860 pointsBadges:
  • Supriyob2
    You can use DSPDBR or option 42 in AldonCMs
    165 pointsBadges:
  • WoodEngineer
    The URL below may not work.  Try this one for a nice utility which should do what you need.

    7,900 pointsBadges:
  • azohawk

    Do all of the programs need to access the new field?  If not, don't recompile the file, use the CHGPF (option 2 on the object in PDM) command to add the new field, then on the logicals. This way the file maintains it file level id (no level check errors) and you only need to recompile the programs that need to access the new file.

    3,235 pointsBadges:
  • kitvb1
    The free version of XrefIT (v1.23) will do it for you. It includes Query, DSPF, PRTF, LF, programs, etc.
    65 pointsBadges:
  • WoodEngineer
    My apologies.  That link did not work.  I just confirmed that the URL below works.  I am pasting it without making it a link.  Maybe that will work better.  Just copy and paste the URL into your browser.

    7,900 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: