Reputation: 71
I was asked to administer the server progress 10.2B on SLES and software system written on it. After half a year, I began understand the intricacies of working with this server and procedures written in ABL. Since I do not have anything except consoles and notebook parsing, certain procedures are more complicated.
Recently, figuring in a long chain of procedures, I had a question: is there any possibility to find out what variables, global variables, shared variables are defined at a particular point of performing a certain procedure?
Upvotes: 1
Views: 1671
Reputation: 8011
Yes, there are. You can always use operating system utilities like grep
.
grep -i "shared var" *.p
Will look for the string "shared var" in any case in all *.p files. You can make this much better and more efficient with any regexp describing exactly what you want to look for.
You can also get some basic help from the compiler (assuming you have a development license of some kind).
Consider these files as a basic example:
proc1.p
=======
DEFINE NEW SHARED VARIABLE bool AS LOGICAL NO-UNDO.
bool = TRUE.
RUN proc2.p.
proc2.p
=======
DEFINE SHARED VARIABLE bool AS LOGICAL NO-UNDO.
DISPLAY bool.
Now you run the compile statement on them with the XREF option.
COMPILE proc1.p SAVE XREF proc1xref.txt.
COMPILE proc2.p SAVE XREF proc2xref.txt.
This will create two cross referencing text files that will look like this:
proc1xref.txt
==============
c:\temp\proc1.p c:\temp\proc1.p 1 COMPILE c:\temp\proc1.p
c:\temp\proc1.p c:\temp\proc1.p 1 CPINTERNAL ISO8859-1
c:\temp\proc1.p c:\temp\proc1.p 1 CPSTREAM ISO8859-1
c:\temp\proc1.p c:\temp\proc1.p 1 STRING "bool" 4 NONE UNTRANSLATABLE
c:\temp\proc1.p c:\temp\proc1.p 1 NEW-SHR-VARIABLE bool
c:\temp\proc1.p c:\temp\proc1.p 3 ACCESS SHARED bool
c:\temp\proc1.p c:\temp\proc1.p 3 UPDATE SHARED bool
c:\temp\proc1.p c:\temp\proc1.p 5 RUN proc2.p
proc2xref.txt
=============
c:\temp\proc2.p c:\temp\proc2.p 1 COMPILE c:\temp\proc2.p
c:\temp\proc2.p c:\temp\proc2.p 1 CPINTERNAL ISO8859-1
c:\temp\proc2.p c:\temp\proc2.p 1 CPSTREAM ISO8859-1
c:\temp\proc2.p c:\temp\proc2.p 1 STRING "bool" 4 NONE UNTRANSLATABLE
c:\temp\proc2.p c:\temp\proc2.p 3 ACCESS SHARED bool
c:\temp\proc2.p c:\temp\proc2.p 3 STRING "yes/no" 6 NONE TRANSLATABLE FORMAT
c:\temp\proc2.p c:\temp\proc2.p 3 STRING "bool" 4 LEFT TRANSLATABLE
c:\temp\proc2.p c:\temp\proc2.p 3 STRING "-------" 7 NONE UNTRANSLATABLE
"NEW-SHR-VARIABLE bool"
in proc1xref.txt tells you that a shared variable named bool has been created and "ACCESS SHARED bool"
tells you that it has been used.
Upvotes: 1