I know that DDUTILTY INDEX report (-RPT INDEX,VIEW) will list the VIEWs and that DDUTILTY DETAIL report (-RPT DETAIL,VIEW) will list the attribute-types and the current attribute-values for the VIEWs. But, how can I print the content of an SQL VIEW?
To see the content of an SQL VIEW, you can either run DDUTILTY TEXT report:
Or, you can run the DDTRSLM utility EXPORT feature to extract the VIEW:
EXPORT VIEW authid.viewname;
WIth EXPORT, the CREATE VIEW syntax can be found in the TRANSF output between the %DDLSTART and %DDLEND statements.
Both methods will give all of the SQLSOURCE text associated with the VIEW, showing the original DDL CREATE VIEW statement.
Both the DDUTILTY and the DDTRSLM batch utilities are documented in the Datacom/DB Datadictionary Batch Reference Guide.
See also in the CA Datacom Video Library the following item: Getting the DDL from DDOL and from a DML query.