D2TP (Template create/update) batch command

Purpose

To create or update a template based on one Db2® object. The object must be accessible from the currently connected Db2® system.

Usage

The FM/Db2 template create/update utility creates a template if it does not exist, or updates the template if it does exist.


1  D2TP
1  OBJIN=? ? location. owner. name
1 ? ? OBJILOCN=location OBJIOWNER=owner OBJINAME=name
1! TOUTPUT=TDDOUT
1 TOUTPUT=ddname?TOUTMEM=member
1 TMOUT=template_data_set_name(member)
OBJIN location.owner.object
The optional name of the Db2® remote server (location) where the source object is located; the optional name of the owner of the source object (owner) and the source object name (name).

When location is not specified the current (local) Db2® server is used. When the owner is not specified the object name is qualified using the current SQLID. When FM/Db2 generates the utility control statements, the owner value is non-blank.

OBJIN should be used when the fully qualified name fits on a single line in the JCL deck. The last usable column is column 71. When the fully qualified name does not fit on a single line in the JCL deck, use one or more of the OBJILOCN, OBJIOWNR, OBJINAME keywords to specify the object.

OBJILOCN=location
The optional name of the Db2® remote server (location) where the source object is located. See Specifying a Db2 object name.
OBJIOWNR=owner
The optional name of the owner of the source object (owner). See Specifying a Db2 object name.
OBJINAME=name
The object name (name) for the source object. See Specifying a Db2 object name.
TOUTPUT=ddname
Defines a reference to a DD statement for the data sets which contain the Db2® template that describes the target Db2® object. Concatenated DD statements are not supported and the referenced data set must be catalogued. If you have not specified a member name in the referenced DD statement, then you must provide a TOUTMEM keyword. If no TOUTPUT or TMOUT parameter has been provided, then TOUTPUT=TDDOUT is used. See Specifying the template for a Db2 object.
TOUTMEM=member
The name of the template member in the dataset identified by the TOUTPUT or TMOUT parameter. This parameter is ignored if the member name is provided with the DD statement or the TMOUT parameter. See Specifying the template for a Db2 object.
TMOUT=template_data_set_name(member)
The PDS (template_data_set_name) and member name (member) of the File Manager template that describes the target Db2® object. See Specifying the template for a Db2 object.

Examples

Example 1: Create a Db2® template for the DSN8810.EMP using TMOUT keyword.

//D2TPJOB (acct),'name'
//* Create template FMN.TEMPLATE(EMP) for DSN8810.EMP table
//*
//FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=DSN1,SQID=ID1')
//STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR
//         DD DSN=DB2V810.DSN1.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSIN    DD *
$$FILEM D2TP OBJIN="DSN8810"."EMP",
$$FILEM TMOUT=FMN.TEMPLATE(EMP)
/*

Example 2: Use TOUTPUT, TOUTMEM keywords to create output template for DSN8810.EMP

//D2TPJOB (acct),'name'
//* Create template FMN.TEMPLATE(EMP) for DSN8810.EMP table
//*
//FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=DSN1,SQID=ID1')
//STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR
//         DD DSN=DB2V810.DSN1.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
//TOUT  DD DSN=FMN.TEMPLATE,DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSIN    DD *
$$FILEM D2TP OBJIN="DSN8810"."EMP",
$$FILEM TOUTPUT=TOUT,TOUTMEM=EMP
/*

Example 3: Use Default output DD TDDOUT with TOUTMEM to create output template for DSN8810.EMP

//D2TPJOB (acct),'name'
//* Create template FMN.TEMPLATE(EMP) for DSN8810.EMP table
//*
//FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=DSN1,SQID=ID1')
//STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR
//         DD DSN=DB2V810.DSN1.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
//TDDOUT  DD DSN=FMN.TEMPLATE,DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSIN    DD *
$$FILEM D2TP OBJIN="DSN8810"."EMP",
$$FILEM TOUTMEM=EMP
/*

Example 4: Use Default output DD TDDOUT with member to create output template for DSN8810.EMP

//D2TPJOB (acct),'name'
//* Create template FMN.TEMPLATE(EMP) for DSN8810.EMP table
//*
//FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=DSN1,SQID=ID1')
//STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR
//         DD DSN=DB2V810.DSN1.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
//TDDOUT  DD DSN=FMN.TEMPLATE(EMP),DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSIN    DD *
$$FILEM D2TP OBJIN="DSN8810"."EMP"
/*

Example 5: Create 3 templates

//D2TPJOB (acct),'name'
//* Create template TOUT1-3 for DSN8810.EMP table
//*
//FMNDB2   EXEC PGM=FMNDB2,PARM=('SSID=DSN1,SQID=ID1')
//STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR
//         DD DSN=DB2V810.DSN1.SDSNEXIT,DISP=SHR
//         DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
//TOUT1  DD DSN=FMN.TEMPLATE(T1),DISP=SHR
//TOUT2  DD DSN=FMN.TEMPLATE(T2),DISP=SHR
//TOUT3  DD DSN=FMN.TEMPLATE(T3),DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSIN    DD *
$$FILEM D2TP OBJIN="DSN8810"."EMP",TOUTPUT=TOUT1
$$FILEM D2TP OBJIN="DSN8810"."EMP",TOUTPUT=TOUT2
$$FILEM D2TP OBJIN="DSN8810"."EMP",TOUTPUT=TOUT3
/*