Can 2E do Impact Analysis?
Recently I was asked the following Question, and I thought it would be a good topic to post on the Wiki.
Question: I am doing an impact analysis on three fields on a claim file. Synon generates code for hidden positioners and so on. Due to this Synon & Hawkeye both list just about all programs that use the claim file. I had to manually search through the RPG code for over 150 programs, which makes me wonder if there is not a better way. Do either of you know about any Synon tools that can due a true impact analysis & weed out the hidden stuff? Or is there already a way to do that in Synon? If so that would save a ton of time.
Answer: Yes, 2E has excellent impact analysis tools built in. To perform impact analysis on a given field, do the following:
1. Working in the PDM interface option 5 from the menu "Work with Model Objects"
2. Press F7 to position the subfile, and F11 a couple times until you get to Position by Object Type 3. Select Type FLD, and then type your field name
4. Then select USAGES/Object (option 91) against the field. You get:
This shows everything that uses the field directly.
From here you can also do some more intense impact analysis. By taking an option 95 against the field you can simulate a public change, meaning Synon will show you all the files and functions you need to edit or regen if you change the field. This is an example screen.
Lines with and EDT action are things that need to be looked at and potentially modified. Lines with a GEN action are things that just need to be generated. This will go all the way down to external functions, and some objects will be in the list more than once depending on where the dependencies are found in the model. In any case you will have to generate all file objects and external program objects in this list. You can use F16 to build a model list from here, and it will extract everything one time into that list. Then you can back out to the Edit Model Object List and change the list from *ALLOBJ to the list you just copied the impact analysis to, and from there you can see just the objects affected by your change.
You can do this multiple times if you are going to change multiple objects, and just add to the model list for each impact analysis, or you can create separate model lists. Hit F11 a couple times to see the required action from this model list.