ABL2DB

tamhas

ProgressTalk.com Sponsor
At the recent PUG Challenge Americas I presented a paper "What Code Updates That Field and Similar Problems?: Databasing ABL Code and Data Relationships for Analysis" (available at http://cintegrity.com/content/Databasing-ABL-Code-and-Data-Relationships ) that presented a new open source tool for collecting a wide variety of information about one's code base and putting this into a database for analysis and reporting. A preliminary version of this tool is now available at http://www.oehive.org/ABL2DB for download and experimentation.

No doubt, as people play with it they will discover issues which need to be fixed, either bugs (I've found some!) or issues about particular code bases which need adaptation. I have anticipated some possible issues about code base dependency and designed the code to be easy to adapt around those issues. I *strongly* encourage feedback about problems or ideas for extending it to capture more information. The presentation includes several projects which are already on the roadmap.

This tool is *like* the tools some of you may have for databasing XREF information, but I think it goes beyond them and, in time, will go far beyond. You can see the current coverage by looking at the data structure diagrams in the presentation. There is a lot one can do with this just by writing question-specific queries, but I hope over time to build up a library of reports to address some larger scope issues.

Enjoy and feedback is strongly encouraged!
 

Cringer

ProgressTalk.com Moderator
Staff member
This is great stuff. Do you have a sample .st for the database? Or do I need to extrapolate it from the .df?
 

tamhas

ProgressTalk.com Sponsor
I am just using

#
b .
#
d "Schema Area":6,64;1 .
d "Data":7,128;8 .
d "Index":8,128;8 .
d "LOB":9,128;8 .

I figured that people would do their own DBA thing, but I guess I can post this too.

Done.
 

tamhas

ProgressTalk.com Sponsor
I have no .df that uses LOBs at the moment or they would already be there. Likewise all the schema related to non-OE databases. All to be added as soon as there is a need and a sample to work from.
 

Cringer

ProgressTalk.com Moderator
Staff member
Thanks Thomas. So to get this started, all I need to do (other than set up a project and db) is to change the vars at the top of the launcher to match my code?
 

tamhas

ProgressTalk.com Sponsor
Right, Rob, the .st is really just my default for anything.

Yes, Cringer, that and build the right .df. For my purposes, I had to combine three .dfs, but in the simple case just dumping one from the relevant DB would do it.
 

Cringer

ProgressTalk.com Moderator
Staff member
I'll have a play around with it next week. Should be a really useful tool for us if I can get it up and running.
 

tamhas

ProgressTalk.com Sponsor
Great. If there are any issues, be sure to contact me at thomas at cintegrity dot com.
 
Hi Tamhas,
Thanks for this wonderful utility.
I am working on a project whose first program was written in 1983. Now its a huge one around 30000 .Ps with many include files with a disk space of around 1GB.
There is no documentation available and it was tough to find a business logic behind the field.
I wrote the same XREF utility, but not this much structured one. But I am not able to extract the program calls which are stored in DB and what is the trigger point to call those programs.
Is there any way to explore this part?
Apart from this I am able to achieve -
Field level impact analysis.
Program flow from a given program backward/forward
Tables being Read/Write in a given program.
Index utilization in a given program.
Include file where all being utilized.
All the internal procedures & functions.

But didn't look at LISTING options as it is much towards scope & blocks.
 

tamhas

ProgressTalk.com Sponsor
The current release has the calls from one compile unit to another and from a compile unit to compile sub units (IPs, e.g.) within the same compile unit. I will soon be adding:
1) calls to a compile subunit in a different compile unit, i.e., PPs and SPs.
2) resolution of dynamic calls (e.g., run value).

I am not sure what you mean by "trigger point".

Note that I am well aware that a bunch of people have written pieces of this before and/or are using tool sets from their ISV which include some of this. My goal is to create something which is a substantial superset of all of those and to provide it as open source so that anyone can use it.

The existing version does already include the blocks and buffers from LISTING including the transaction scope, so it should be an easy thing to search for buffers scoped to the procedure and transactions scoped to the procedure, for example.
 

Cringer

ProgressTalk.com Moderator
Staff member
Getting an error in the log that the DB is in use in multi user mode. Is it possible to run it as a multi user session?
 

tamhas

ProgressTalk.com Sponsor
The connection to the Analysis DB is managed by PDSOE, so presumably this is related to the compile phase where it needs to connect to your application DB(s). This is done on line 70 of the Driver.cls, so you could just remove the -1 if you wanted. My idea here is that you would create an(some) empty DB(s) with the application schema which were used solely for the compile phase so that you didn't need to worry about servers, competition, etc. If you do that, you won't have this issue since it will connect, compile, and disconnect. One only runs into competition if the same DB(s) is used for another PDSOE project and you open that!
 

Cringer

ProgressTalk.com Moderator
Staff member
Thanks Thomas. I'll initially be working against my working copy of the db to get things working. Makes sense to have a schema only copy for it at some point though.
 

tamhas

ProgressTalk.com Sponsor
Given that one has to create a .df anyway, building a schema only DB for the purpose is not exactly time consuming or difficult! :)
 

tamhas

ProgressTalk.com Sponsor
Great! The more the merrier ... the more environments we test it against, the more solid it will be and the more variations it will accommodate ... and. hopefully, the more ideas we will get for ways to extend it.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
I've installed it and created schema holders and have gotten as far as the site customization. If I understand correctly, for federated applications you have to create a master schema file that is the union of all DB schemas (chSchemaFile). I don't understand the purpose of that when I have already recreated the application DBs separately (chDataBaseList). I can do this but I could see it being a problem for someone else, e.g. if they had tables in two different DBs with the same name. Do you handle that scenario?

Also, are the menu/menu item lists required to use the tool? Our menu system is pretty extensive so this would be a rather labour-intensive task.

Unfortunately I don't have too much time to devote to this at the moment. I'll try to spend some more time with it next week and ask some more specific questions.
 
Top