A program Cross-reference

If you walk into an AS/400 shop with no Hawkeye or crossreference capability, how could you determine the impact of changes? First, you will use the DSPPGMREF command to extract the program calls. But then to lookup each program to be modified will take 2 lookups, unless the logical below is built. We need to see what the program calls and to see what calls it. Each program will only require one lookup and a screen print to get the impact information needed.

So the first step, to DSPPGMREF…

Generate a Program Crossreference File in your Programmer Library

/------------------------------------------------------------------\

Display Program References (DSPPGMREF)

Type choices, press Enter.

Program . . . . . . . . . . . . > *ALL Name, generic*, *ALL

Library . . . . . . . . . . . > RSCUST Name, *LIBL, *CURLIB...

Output . . . . . . . . . . . . . > *OUTFILE *, *PRINT, *OUTFILE

Object type . . . . . . . . . . *PGM *ALL, *PGM, *SQLPKG...

+ for more values

File to receive output . . . . . qdsppgmref Name

Library . . . . . . . . . . . jvoris Name, *LIBL, *CURLIB

Output member options:

Member to receive output . . . *FIRST Name, *FIRST

Replace or add records . . . . *add *REPLACE, *ADD

 

In fact, DBU or other utility that can export DDS is a help to reduce the keying of the logical file DDS source.

When done, the output below for the RSGAM file shows that RSCAM calls it and that it is using the RSLAM01 file and the RSLAM02 file, etc.

Here is the DBU screen of the quick and dirty Program Crossreference.

Keying in the program RSGAM shows it is called by RSCAM. And it has dependancies on files RSLAM01, RSLAM02 etc and the print file RSTAM.

 

A* A simple HAWKEYE-style Program Crossreference

A*

A* If you find yourself using Query and SCANS to get Cross-

A* reference information, try a file with Keys over both

A* CALLED and CALLER pgms/objects.

A*

A*

A* A Programming Example of a Multi-Format file

A* with a single physical used in both formats

A*

A* Prepared for Del Valley Computer Users Group

A* by John Voris Consulting, Inc 610-873-0870

A* (all rights reserved)

A* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

A*

A* QDSPPGMREF IS THE PHYSICAL FILE

A*

A* FMT CALLER IS THE FORMAT FROM DSPPGMREF (shows CALLED)

A* FMT CALLED IS THE FORMAT WE CONSTRUCTED (shows CALLER)

A

A R CALLER PFILE(QDSPPGMREF)

A

A TEXT('the raw info from +

A the DSPPGMREF command')

A

A WHPNAM R COLHDG('Program')

A WHFNAM R COLHDG('Object' 'Ref.d' '1=*exp')

A

A WHOBJT R COLHDG('Obj Type' 'F=file' 'P=prg')

A WHFUSG R COLHDG('1=i,2=o' '3=i/o,4=u' -

A '5=i/u,6')

A WHOTYP R COLHDG('Object type')

A WHTEXT R COLHDG('Text')

A WHSPKG R COLHDG('Pgm=p' 'Sqlpkg=s' -

A 'Srvpgm=v')

A

A K WHPNAM

A K WHFNAM

A

A* - - - - - - - - - - - - - - - - - -

A

A* A Programming Example of a Multi-Format file

A* with a single physical used in both formats

(continued)

A R CALLED PFILE(QDSPPGMREF)

A TEXT('the reverse sort of +

A the DSPPGMREF command')

A

A WHPNAM R 10 RENAME(WHFNAM)

A COLHDG('Program')

A WHFNAM R 11 RENAME(WHPNAM)

A COLHDG('Object' 'Ref.d' '1=*exp')

A

A WHTEXT R COLHDG('Text')

A* But note that the fields for usage and object type

A* are incorrect -- they only apply to the CALLER pgm

A*

A WHFUSG R COLHDG('1=i,2=o' '3=i/o,4=u' -

A '5=i/u,6')

A WHOBJT R COLHDG('Obj Type' 'F=file' 'P=prg')

A WHOTYP R COLHDG('Object type')

A WHSPKG R COLHDG('Pgm=p' 'Sqlpkg=s' -

A 'Srvpgm=v')

A

A K WHPNAM

A K WHFNAM

A

A

A***********************************************************

A* FYI - here are all the fields generated by the IBM command

A* DSPPGMREF

A*

A* R QWHDRPPR

A* WHLIB 10 TEXT('Library')

A* WHPNAM 10 TEXT('Program')

A* WHTEXT 50 TEXT('Text ''description''')

A* WHFNUM 5S 0 TEXT('Number of objects referen')

A* WHDTTM 13 TEXT('Retrieval date: century/')

A* WHFNAM 11 TEXT('Object referenced: 1=*exp')

A* WHLNAM 11 TEXT('Library referenced: 1=*ex')

A* WHSNAM 11 TEXT('File name in source progr')

A* WHRFNO 3S 0 TEXT('Number of record formats')

A* WHFUSG 2S 0 TEXT('1=i,2=o,3=i/o,4=u,5=i/u,6')

A* WHRFNM 10 TEXT('Record format referenced')

A* WHRFSN 13 TEXT('Format level identifier')

A* WHRFFN 5S 0 TEXT('Number of fields')

A* WHOBJT 1 TEXT('Object type: F=file, P=pr')

A* WHOTYP 10 TEXT('Object type')

A* WHSYSN 8 TEXT('System Name (source Syste')

A* WHSPKG 1 TEXT('Pgm=p, Sqlpkg=s, Srvpgm=v')

A* WHRFNB 5S 0 TEXT('Number of record formats')