Hi Nic!
Yes, storing the DDL in a PDS so you can Library Manage it is a damned good idea?
Anyhow, (and as a confirmed true-blue biggot I hate to say this but…)...
If you have Platinum’s “RC/Query†installed (it's within CA Database Management Solutions for DB2 for z/OSâ€), as I do on the Customer’s site that I am using at the moment, then you can get the DDL out using command “DDL†against a TABLE (or an INDEX or TABLESPACE).
RQTL R14 --------------- RC/Q Table List --------------- 06-02-11 10:28
COMMAND ===> SCROLL ===> PAGE
DB2 Object ===> T Option ===> L Where => N
Table Name ===> SAMPTABL > Creator ===> * >
Qualifier ===> * > Grantor ===> * >
Loc: LOCAL ---------- SSID: DB2A ----------XSTECOA - LINE 1 OF 2 >
CMD TABLE NAME CREATOR DATABASE TBLSPACE NUMBER OF ROWS
DDL_____ SAMPTABL ACPT PIDANORT PISSNX45 157,785
________ SAMPTABL PROD PIDSNORT PISSNX45 159,475
******************************* BOTTOM OF DATA ********************************
And this might look like this…
PTBPDI R14 -------- Batch Processor Display Input -------- 06-02-11 10:39
COMMAND ===> SCROLL ===> PAGE
Mode ===> O ONLINE
The following Batch Processor input has been generated. Press ENTER
to process, press END to cancel, or enter the EDIT command to edit.
------------------------------------------------------------------------- XSTEC
********************************* TOP OF DATA *********************************
.CONNECT DB2A
SET CURRENT SQLID = 'ACPT';
CREATE TABLE ACPT.SAMPTABL
(DIVNUM INTEGER NOT NULL
WITH DEFAULT
,CONID CHARACTER(30) FOR SBCS DATA
NOT NULL
WITH DEFAULT
,ALTERNATE_ID CHARACTER(30) FOR SBCS DATA
NOT NULL
WITH DEFAULT
,ALTERNATE_ID_TYPE CHARACTER(50) FOR SBCS DATA
NOT NULL
WITH DEFAULT
,BACKID CHARACTER(30) FOR SBCS DATA
NOT NULL
WITH DEFAULT
Press ENTER to process Press END (PF3/15) to quit
*PTPBPDI
I don’t know if any of the IBM Tools do this – thinking FileManager for DB2? :/
On the other hand one could do it by-hand and execute a DESCRIBE on a table and get a lot of the info that way?
(this is from memory so do an RTFM first? )…In REXX…
. . .
PARSE VALUE 0 WITH . col. 1 col.0 typ. 1 typ.0 . sqlda.
table = 'SAMPTABL'
ADDRESS DSNREXX "EXECSQL DESCRIBE TABLE :TABLE INTO :SQLDA"
DO i = 1 TO sqlda.sqld
col.i = sqlda.i.sqlname
typ.i = sqlda.i.sqltype
END
PARSE VALUE i-1 WITH col.0 1 typ.0
. . .