Declaration Generator is a command through which we can extract the DDL of the table.It produces an SQL DECLARE TABLE Statement.
It also generates the data type declaration of each column in the assigned language ie. COBOL,PL/I,C.
The DCLGEN can be executed in Online as well as Batch.
In Online it can be done through DB2I(Interactive Menu)
In Batch,you can use DCLGEN command along with the parameters after connecting to the system through DSN.
For executing it in batch you can find the sample job in your SDSNSAMP library.Search for the members DSNTEJ2C and DSNTEJ2P.
You can also execute DCLGEN directly from TSO.Sign on to TSO, issue the TSO command DSN, and then issue the subcommand DCLGEN.
Following is the sample JCL to execute DCLGEN-:
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 //DCLGENJ JOB (*******),'DCLGEN (DB2)',
000002 // TIME=(0,20),NOTIFY=&SYSUID,MSGCLASS=X,REGION=0M,
000003 // USER=XXXXX,PASSWORD=
000004 //*
000005 //* STEP 1: CREATE COPY FILE TABLE DESCRIPTIONS (DCLGEN)
000006 //PH02CS01 EXEC PGM=IKJEFT01,DYNAMNBR=20
000007 //STEPLIB DD DSN=XXXXXX.SDSNLOAD,DISP=SHR
000008 // DD DISP=SHR,DSN=XXXXXX.SDSNEXIT
000009 //SYSTSPRT DD SYSOUT=*,DCB=(RECFM=F,LRECL=200,BLKSIZE=200)
000010 //SYSUDUMP DD SYSOUT=*
000011 //SYSTSIN DD *
000012 DSN SYSTEM(DSN)
000013 DCLGEN TABLE(XXXXXX.TEST) +
000014 LIBRARY(XXX.XXXXX..XXX.XXXXX(XXXX)') +
000015 ACTION(ADD) APOST +
000016 LANGUAGE(IBMCOB) +
000017 STRUCTURE(POPTVAL)
000018 END
//*
Cheers!!!!