These sound like questions that Natural Engineer can answer. It is also possible to get some helpful information with Predict XREF to identify objects that exist but are not referenced.
I don’t think one can provide “code” to answer your questions.
Here’s a screenshot of the regarding Predict XREF menu:
10:32:07 ***** P R E D I C T 4.6.1 ***** 2011-05-13
Library: TEST - Verify Appl. Integrity - DBnr: 22 Fnr: 20
Code Function
X Consistency of application
I Objects not implemented but referenced
R Objects implemented but not referenced
A Verify all
Code: ?
Command ===>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Invp GDAV Quit Sets Rule Copy Xref View OSet SPfk Main Exit
And the submenu “Objects implemented but not referenced” looks like that:
10:32:40 ***** P R E D I C T 4.6.1 ***** 2011-05-13
Library: TEST - Verify References - DBnr: 22 Fnr: 20
Code Function
D Data areas not referenced
V Variables in data area not referenced
U Programs with unused data areas
C Copycodes not referenced
N Error numbers not referenced
P Programs not referenced
I Programs not impl./ref. starting from one
Code: ? Save set: N (Y,N)
Data area: Data area type : (?)
Program type: (?)
Program:
Command ==>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Invp GDAV Quit Sets Rule Copy Xref View OSet SPfk Main Exit
My guess, and that is all it is, a guess, is that you are somewhat new to Natural. As the “newbie” you have been given the task of “cleaning up” some old code. Before you go down the wrong path, you might want to consider:
Variables in a data area not used in a main program.
If you look a couple of levels down, you may well find the same data area used to
communicate ALL of the variables between two or more objects. This was, and is,
a fairly common coding technique in Natural. Do not remove variables from
a data area until you are sure that they are never used in any object.
Unused subroutines
I am not very fond of the following, but it is quite common. There is a subroutine,
which lets say computes a discount for a product. Way back when, the “old” logic
for the discount was discontinued. A new subroutine was written. The old
subroutine was simply left in the code as an archival history. I think the code
should at least be commented out along with comments indicating the name
of the new subroutine. Actually, I think there should be archived versions of the
entire object; but many people think this to be excessive. They have not had to
read through code where the commented out code is three times the size of the
“active” code.
references to objects that are not executed
Once again, probably there for historical reasons. Without some form of archiving
if you remove these references you may remove all information regarding the
previous “states” of a system.
As Brian indicated, the only software that really exists are add on products, whether from Software AG or other vendors. Depending on the size (number of objects, size of the objects) of the system, you may want to employ a lot of your own “elbow grease” and use SCANs to find references. This is an excellent way to learn about a system.