A user needs to identify the layout for a Datacom/DB table, or to generate COBOL copybooks for application development or maintenance.
Datacom table metadata is stored within the Datadictionary (DD). Standard reports like the database directory (CXX) report do not provide individual field-level layouts or COBOL-formatted copy members.
To generate a COBOL copybook or a field layout report, use the Datadictionary batch utility (DDUTILTY).
1. Identify the table name and the status (usually PROD) in the Datadictionary (DD).
2. Execute the following sample JCL to generate a COBOL copybook into a partitioned dataset (PDS):
//*<Your Job statements go here>
//*
//* -----------+-----------------------------------------------------*
//* This job will Produce a CXX report for the desired database ID,
//* and will create COBOL copybooks for tables in a database,
//* storing them in a new PDS created in this job.
//*
//* Note: Follow instructions in the !!!! section below to
//* process your list of tables.
//*
//* Expected CC: 0
//*
//* Review Copybook Doc If Needed: https://brcm.tech/COPYBOOK
//*
// EXPORT SYMLIST=(*) << Do NOT change or remove this
//*
//* Enter the loadlibs and CXX DSN for the Datacom MUF:
// SET DBCUS=THIS.IS.YOUR.MUF.CUSLIB
// SET DBBAS=THIS.IS.YOUR.DATACOM.BASE.LOADLIB
// SET DBIPC=THIS.IS.YOUR.DATACOM.IPC.LOADLIB
// SET DBCXX=THIS.IS.YOUR.DATACOM.CXX.FILE
//*
//* Which DBID and Datadictionary occurrence should we process?
// SET DBID=####,DBNAME=<<your DATABASE name here>>
//*
//* What is the DSN for the new PDS we will create with the
//* COBOL Copybooks?
//* NOTE: The new PDS will be deleted and then created in this job
// SET COPYPDS=THIS.IS.YOUR.NEW.COPYBOOK.PDS
//*
//* Uncomment one of the following lines to allocate the PDS:
//* SET PDSLOC='UNIT=3390,VOL=SER=VVVVVV'
//* SET PDSLOC='MGMTCLAS=MMMMMMMM,STORCLAS=SSSSSSSS,DATACLAS=DDDDDDDD'
//*
//* -----------------------------------------------------------------*
//* Do not change anything below this line unless directed. *
//* *
//*
//DBUTLTY EXEC PGM=DBUTLTY,REGION=0M
//STEPLIB DD DISP=SHR,DSN=&DBCUS
// DD DISP=SHR,DSN=&DBBAS
// DD DISP=SHR,DSN=&DBIPC
//CXX DD DISP=SHR,DSN=&DBCXX
//SYSOUT DD SYSOUT=*
//DDSNAP DD SYSOUT=*
//SYSSNAP DD SYSOUT=*
//SNAPER DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=(JCLONLY)
COMM DBID=&DBID,OPTION=STATS
REPORT DBID=&DBID,AREA=CXX,TYPE=A
REPORT DBID=&DBID,AREA=CXX
/*
//* - - - - - -C- - - - - - - - - - - - - - - - - - - - - - - - - - -7
//GENCOPY EXEC PGM=DDUTILTY,REGION=0M
//STEPLIB DD DISP=SHR,DSN=&DBCUS
// DD DISP=SHR,DSN=&DBBAS
// DD DISP=SHR,DSN=&DBIPC
//*
//SYSOUT DD SYSOUT=*
//DDSNAP DD SYSOUT=*
//SYSSNAP DD SYSOUT=*
//SNAPER DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//SYSPUNCH DD DISP=(,PASS),DSN=&&SPUNCH,
// LRECL=80,SPACE=(TRK,(15,5)),RECFM=FB
//SYSIN DD *
-USR DATACOM-INSTALL,NEWUSER
-DEF PATH,STANDARD
-DEF TRACE,DATABASE.AREA,$INTERNAL
-DEF TRACE,AREA.TABLE,$INTERNAL
-DEF TRACE,TABLE.FIELD,$INTERNAL
-END
-RPT START,DATABASE,&DBNAME (PROD),STANDARD
-RPT DETAIL
-RPT FIELD
-END
-UTL MODE SQL
-UTL LIBRARY,OS
-UTL LANGUAGE,COBOL,DESCRIPTION,OCCURRENCE
-COM ---------------------------!!!!---------------------------------
-COM Repeat the set of 3 lines for each table, using Datadictionary
-COM occurrence name for the table, and the member name to store into
-COM the PDS.
-COM
-RPT START,TABLE,<<Your TABLE name here>> (PROD),STANDARD
-UTL COPY,TABLE,<<Member>>
-END
-COM
-COM ---------------------------!!!!---------------------------------
/*
//* - - - - - -C- - - - - - - - - - - - - - - - - - - - - - - - - - -7
//DELETPDS EXEC PGM=IDCAMS,REGION=0K,COND=(0,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=(JCLONLY)
DELETE ©PDS
SET MAXCC=0
/*
//* - - - - - -C- - - - - - - - - - - - - - - - - - - - - - - - - - -7
//ADD2PDS EXEC PGM=IEBUPDTE,PARM=NEW,COND=(0,LT)
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DISP=(,CATLG),DSN=©PDS,
// &PDSLOC,
// LRECL=80,SPACE=(CYL,(5,1,20)),RECFM=FB,BLKSIZE=0
//SYSIN DD DISP=(OLD,DELETE),DSN=&&SPUNCH
//*
//