We are in the process of mining the existing system for business rules.
We would like to speed up the process by exracting logic from the source.
In principle the compiler interrogates the source to be able to compile. I would like to use the same method it uses to identify the “IF logical-condition”.
Is there a way I could interface with the compiler, or are there user functions that can interrogate code and extract statements and conditions etc?
I am aware of the ability to call API functions like USR2018N. I could not find other functions that could do more, or any documentation on the funcitons that are available to me.
USR2014 and 2019 might help.
Be aware that you will get many “false” hits; for example IF #FLAG where #FLAG is a logical variable that has to do with “navigating” around a single program or inter program.
You might easily overlook statement pairs like EXAMINE-IF where the IF does not look like a business rule since it is just something like IF #NUMBER GT 0, but with the EXAMINE it is really testing to see if an order has been shipped.
You will also have to look for DECIDE statements, WITH/WHERE clauses, ad nauseum. And do not forget Processing Rules (if you use them) which often contain business rules.
good luck, and keep the forum apprised of your progress; there may be others interested in the work.
Thank you for the response.
I absolutely agree on all your comments. We have the typical problem of migrating to a new solution/arch but no subject matter experts around - retired or worse.
- Where can I find documentation on all the available functions?
- Where can I find documentation on all the available interfaces? ( Obviously I need to know the params or data types they require but also the objetcs they are calling in return.
- Where can I find documentation on how to talk to the compiler (which is already doing all this work when compiling)?
http://techcommunity.softwareag.com/ecosystem/documentation/ provides publicly-accessible documentation for current versions of Software AG products.
You might also take a look at Natural Engineer as it may be able to assist you in analyzing your applications.
- If you mean all the USR subprograms enter SYSEXT in the command line.
- The single USR subprograms are documented in the text members with the same name, e.g. USR2018T for USR2018N. You don’t need to know which other modules will be called. They should be all in steplibs found by the USR subprograms.
- As far as I know the compiler on open systems or on mainframe is not callable from a program. It can only be started from the Natural command line.
If you are working on the mainframe the STRUCT command may be of use. The STRUCT menu offers function W - “Write structure of source into work area”. It writes text into the source area. An “I” on the right side indicates an IF statement.