As a mainframe programmer or designer, we would have done the impact analysis of changing a component (be it a copybook or a SYSIN card or a DB2 Table or a program or a JCL or so on), which we have to do a lot of times. For doing this we usually run SRCHFOR or PDSMAN scans to find out the cross reference of the modules in other components.
Say for example, we have to change a copybook, we search for all the cobol programs which use the copybook so as to see if a compile is required. Further we would be searching for these Cobol programs in the JCL and Proclib Libraries to see all the places where these programs are used. The process continues till we reach the end point of analysis.
Now this process takes a lot of efforts and time as a lot of time is wasted to run the searches and this also breaks the flow of analysis of the modules, which is the actual work of the programmer. To overcome this problem, I have built the Xref and Impact Analysis tool.
Tool Components and Modules:
The tool essentially has two major processes:
- Xref Build Process which scans for cross references of the modules amongst the related components. This is the backend process which can be run periodically depending on the frequency of your application changes.
- The Tool Interface which the programmer uses to find the cross references of any module and aids in the impact analysis process.
The tool consists of the following modules:
- XREFCBLD : Scans for Cross Reference between modules. Like Cross Reference of copybooks in Cobol Programs and Cobol Programs in Sysins and JCLs etc. The scans are done based on the definitions of source-target relationships in the Inrelf File.
- XREFDBLD: Scans for cross references of DB2 tables and views in Application components. The DB2 tables and views used in application modules are gotten from the sysibm.systables with given qualifiers as mentioned in the INRELF files.
- XREF: This is the Interface program, which the programmer uses for his impact analysis. This screen presents to you the cross-reference data that has been built by the previously mentioned modules in a manner which aids you in your multi level impact analysis process.
ISPPLIBs: XREFPNL1 and XREFPNL2
Parameter File: INRELF: This is the main driver file to build the Xref Databases. You mention The source libraries along with their relationship with the target libraries. This will be discussed in more details in the set up secion. A sample INRELF file is also present in the zip file.
All these modules are attached in the zip file below.
Set Up Process:
- Place the rexx modules in your rexx library and the ISPF panels in your ISPPLIB library.
- Set up Your Inrelf File. The structure of the inrelf File is as below:
Position 1 – 40 : Target Library. Target Library is the library whose modules may be referenced in the modules of the Source Library.
Position 41 – 50: Type of Target Library components. Basically below are the types for various kinds of components:
- Sysins: SYSN
- Copybooks: COPY
- JCLS: JCL
- Cobol Programs: COB
- JCL Procs: JPRO
- EZT Programs: EZT
- EZMaclibs: EZM
- DB2 tables and Views: DB2
Position 51 – 90: Source Library. It is the library whose members are scanned thru to find if they contain the names of the members of the Target library.
Position 91 – 100: Source Library Type.
Comments can be written starting with “—“ i.e two dashes or hyphens.
Excepting for the comments, the data records should be sorted based on Traget Library. i.e ideally all the records for the same target library should be placed together in the file.
- Set the following variables in the init_Process routine of the XREFCBLD,XREFDBLD and XREF Rexx programs: hlq1, hlq2, hlq3, inrelf, "LIBDEF ISPPLIB".
- Run the XREFCBLD and XREFDBLD commands which submits various scan jobs – one each for every Target Library in Inrelf File. Note that the execution of the command may take some time depending on the number of libraries defined as target and source libraries. The command goes inside each PDS and first cross verifies existence, finds number of members, builds scan member list etc before submitting the jobs. You can very well call these commands from a batch job scheduled in your scheduler. The jobs will create the output XREF Data files with names “(hlq1)
.(hlq2) .(jobname) .(type) .SCANRPT”. Please note that these jobs are restartable from the abending step in case they abend for some reason.
- After all the jobs are done, You can go ahead and start using the tool using XREF command. The usage of the XREF command tool is explained below.
Tool User Guide: