Generate DDL for a Db2 for z/OS database
Introduction
this page explains how to generate DDL for a Db2 z/OS database.
Extraction
CAST recommends the use of the RC/Migrator tool which is part of the CA Database Management Solution for Db2 for Z/OS, Version 19. There are no instructions provided for this. It can operate in batch mode (JCL Job executes Utility) or online mode.
Broadcom knowledge article describing DDL generation and “SQL only” output option
Product documentation set for CA Database Management Solutions for Db2 for z/OS 19
CA RC/Migrator for Db2 for z/OS User Guide
You can also use the BMC Catalog Manager tool, which functions in batch mode (JCL Job executes Utility) or online mode.
You can use ADB2GEN module which is supplied by IBM. You should ignore storage options like tablespaces and storage groupe and also permissions, grant, mask.
You can also extract DDL using DBeaver : DBeaver Enterprise | Professional Database Management , see how to set up and use DB2 with DBeaver .
Extraction example
With DBeaver you can generate SQL DDL from the Database Navigator .
Check if your code is valid SQL
For example, the following is not valid SQL, it seems to be more Mainframe script:
Mainframe alike script - NOK
Create Table 000038000
ABC 000039000
(COL_D INT) 000039010
; 000034000
The correct script should look like this :
SQL alike script - OK
Create Table
ABC
(COL_D INT)
;