automationcommand-line-interfaceopenedgeprogress-dbdata-dictionary

For Progress OpenEdge is there a way to programmatically output the data dictionary detailed table report?


I've developed a lookup utility website to take the detailed table reports that the Data Dictionary produces, to parse that output into useable JSON data with PHP, and then to re-display it in a nice tabular form with JS/HTML/CSS.

I'm seeking to automate the generation of the detailed table definition files in such a way that it can be scheduled to run with cron, the resulting definition file can be copied to my website's directory, and it can to post-processed there. But, I'm not finding any CLI commands for the data dictionary.

Is there any way to do it outside of the terminal GUI, like this documentation demonstrates? https://docs.progress.com/bundle/openedge-database-tools/page/Generate-a-Detailed-Table-Report.html

(Edit for clarity) I don't want to programmatically recreate the report from scratch, myself. I want the data dictionary to output the detailed table report via a cli command, or something similar. Thanks.


Solution

  • The code below will send the output directly to "dictionary.rpt". You can run it from a CLI by using the "mpro" command in the comment.

    /* drpt.p
     *
     * shim to run adecomm/_dtbldat.p
     *
     * mpro /db/s2k128/s2k -b -p drpt.p > log.out
     * 
     */
    define new shared stream rpt.
    find first _db no-lock.
    output stream rpt to value( "dictionary.rpt" ) page-size 0.
    run adecomm/_dtbldat.p ( INPUT recid( _db ), INPUT 'ALL', INPUT 'o' ).
    output stream rpt close.
    

    Parameterizing this is left as an exercise for the reader ;)

    Having said that... parsing the output of the dictionary report is going about this the hard way. IMHO you would be much better off directly querying the meta-schema (_file, _field, and friends) and generating the output that you really need.