Data Profiling Statistics and Key Analysis can be run from a procedure using the following commands:
PROFDATA synonym[.<segment>.<field>] PKEYDATA synonym[.<segment>]
Note that the segment and fieldname must match the case of the elements in the synonym, and are usually uppercase.
To save the output from the report, use the following command:
HOLD FORMAT format AS appdir/filename