DFHDPLOY utility script examples
You can use the following examples to create your own JCL to deploy and undeploy your CICS applications and CICS bundles. This topic also includes examples of DFHDPLOY output for successful and failed scripts.
Sample program DFH$DPLY
The DFH$DPLY sample program contains annotated DFHDPLOY JCL to deploy, undeploy, and optionally set a sample bundle and application in a CICSplex. The sample is supplied in CICSTS53.CICS.SDFHSAMP.
Undeploying a bundle to a DISCARDED state
The following example script connects to MYPLEX and undeploys bundle MYBUND to a DISCARDED state in the CICS regions within MYSCOPE://DFHDPLY1
JOB CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
//*
//DFHPLOY EXEC PGM=DFHDPLOY,REGION=100M
//*
//STEPLIB DD DISP=SHR,DSN=CICSTS53.CICS.SDFHLOAD
// DD DISP=SHR,DSN=CICSTS53.CPSM.SEYUAUTH
*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD *
*
SET CICSPLEX(MYPLEX);
*
UNDEPLOY BUNDLE(MYBUND) SCOPE(MYSCOPE)
TIMEOUT(40) STATE(DISCARDED);
/*
The
following is the DFHDPLOY output for this script when it runs
successfully:DFHRL2132I Analyzing CICS regions and CSD attributes.
DFHRL2093I BUNDLE(MYBUND) found in SCOPE(MYSCOPE).
DFHRL2129I BUNDLE(MYBUND) state is INSTALLED on 2 CICS regions in
SCOPE(MYSCOPE).
DFHRL2129I BUNDLE(MYBUND) state is ENABLED on 2 CICS regions in
SCOPE(MYSCOPE).
DFHRL2054I Setting BUNDLE state to DISABLED. DFHRL2042I Discarding
BUNDLE(MYBUND).
DFHRL2077I BUNDLE(MYBUND) has been discarded from SCOPE(MYSCOPE).
DFHRL2037I UNDEPLOY command successful.The
following is an example of potential DFHDPLOY output for this script when it fails due to timing
out:DFHRL2132I Analyzing CICS regions and CSD attributes.
DFHRL2093I BUNDLE(MYBUND) found in SCOPE(MYSCOPE).
DFHRL2129I BUNDLE(MYBUND) state is INSTALLED on 2 CICS regions in
SCOPE(MYSCOPE).
DFHRL2129I BUNDLE(MYBUND) state is ENABLED on 2 CICS regions in
SCOPE(MYSCOPE).
DFHRL2054I Setting BUNDLE state to DISABLED.
DFHRL2039W The command failed to complete within the specified time out period
of 40 seconds.
DFHRL2129I BUNDLE(MYBUND) state is INSTALLED on 2 CICS regions in
SCOPE(MYSCOPE).
DFHRL2129I BUNDLE(MYBUND) state is ENABLED on 1 CICS regions in
SCOPE(MYSCOPE).
DFHRL2129I BUNDLE(MYBUND) state is DISABLED on 1 CICS regions in
SCOPE(MYSCOPE).
DFHRL2041I TIMEOUT has occurred before BUNDLE(MYBUND) has reached
STATE(DISABLED)
Status of BUNDLE(MYBUND) in SCOPE(MYSCOPE):
CICS ENABLESTATUS AVAILSTATUS
CICSSYS1 ENABLED NONE MYBUND
CICSSYS2 DISABLED NONE MYBUND
All Bundle part records for BUNDLE(MYBUND):
CICS BUNDLE ENABLESTATUS AVAILSTATUS BUNDLEPART
CICSSYS1 MYBUND DISABLED NONE SAMP
https://www.ibm.com/xmlns/prod/cics/bundle/TRANSACTION
CICSSYS1 MYBUND ENABLED NONE SAMPFILE
https://www.ibm.com/xmlns/prod/cics/bundle/FILE
CICSSYS2 MYBUND DISABLED NONE SAMP
https://www.ibm.com/xmlns/prod/cics/bundle/TRANSACTION
CICSSYS2 MYBUND DISABLED NONE SAMPFILE
https://www.ibm.com/xmlns/prod/cics/bundle/FILE
DFHRL2055I Errors have occurred, processing terminated.
Deploying an application to an AVAILABLE state
The following example script connects to MYPLEX and deploys application MYAPP to an AVAILABLE state://DFHDPLY1
JOB CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
//*
//DFHPLOY EXEC PGM=DFHDPLOY,REGION=100M
//*
//STEPLIB DD DISP=SHR,DSN=CICSTS53.CICS.SDFHLOAD
// DD DISP=SHR,DSN=CICSTS53.CPSM.SEYUAUTH
//SYSIN DD *
*
SET CICSPLEX(MYPLEX);
*
DEPLOY APPLICATION(MYAPP)
APPLDIR(/var/cicsts/MYPLEX/myplatform/myapplications/myapplication)
BINDDIR(/var/cicsts/MYPLEX/myplatform/mybindings/mybinding)
TIMEOUT(400) STATE(AVAILABLE);
/*
The
following is the DFHDPLOY output for this script when it runs
successfully:DFHRL2044I CICS application definition(MYAPP) created.
DFHRL2045I CICS application definition(MYAPP) installed.
DFHRL2046I Setting application state to ENABLED.
DFHRL2046I Setting application state to AVAILABLE.
DFHRL2012I DEPLOY command completed successfully.
DFHRL2007I Processing complete.
DFHRL2014I Disconnecting from CICSPLEX(MYPLEX).The
following is an example of potential DFHDPLOY output for this script when it
fails:DFHRL2044I CICS application definition MYAPP created.
DFHRL2045I CICS application definition MYAPP installed.
DFHRL2046I Setting application state to ENABLED.
DFHRL2064I The state of application MYAPP version 0.0.0 is SOMEDISABLED and
availability is UNAVAILABLE.
Application Management part records which did not reach desired state:
ENABLESTATUS AVAILSTATUS BUNDLE(version) REGIONTYPE
SOMEDISABLED NONE BUNDMIX2(0.0.0) RegionType1
SOMEDISABLED NONE BUNDMIX2(0.0.0) RegionType2
DFHRL2064I The state of application MYAPP version 0.0.0 is SOMEDISABLED and
availability is UNAVAILABLE.
Showing all Application Management part records. Record count = 4
ENABLESTATUS AVAILSTATUS BUNDLE(version) REGIONTYPE
SOMEDISABLED NONE BUNDMIX2(0.0.0) RegionType1
SOMEDISABLED NONE BUNDMIX2(0.0.0) RegionType2
ENABLED UNAVAILABLE ProgramEP(1.0.0) RegionType1
ENABLED UNAVAILABLE ProgramEP(1.0.0) RegionType2
DFHRL2055I Errors have occurred. Processing terminated.
DFHRL2014I Disconnecting from CICSplex MYPLEX.Using conditional processing in your DFHDPLOY script
You can use the return code from your DFHDPLOY job to conditionally process later steps by using the JCL COND parameter and the IF/THEN/ELSE/ENDIF statement.The following script uses the
SET APPLICATION command to reattempt
the transition of application MYAPP to an AVAILABLE state, after the first
attempt to deploy the application failed with a return code of 4:
//DPLYAPPL
JOB CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
//*
//DFHDPLOY EXEC PGM=DFHDPLOY,REGION=100M
//*
//STEPLIB DD DISP=SHR,DSN=CICSTS53.CICS.SDFHLOAD
// DD DISP=SHR,DSN=CICSTS53.CPSM.SEYUAUTH
*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD *
*
SET CICSPLEX(MYPLEX);
*
DEPLOY APPLICATION(MYAPP)
APPLDIR(/var/cicsts/MYPLEX/myplatform/myapplications/myapplication)
BINDDIR(/var/cicsts/MYPLEX/myplatform/mybindings/mybinding)
TIMEOUT(10)
STATE(AVAILABLE);
*
//DPLYFAIL IF (DFHDPLOY.RC = 4) THEN
//DFHDPLY2 EXEC PGM=DFHDPLOY,REGION=100M
//*
//STEPLIB DD DISP=SHR,DSN=CICSTS53.CICS.SDFHLOAD
// DD DISP=SHR,DSN=CICSTS53.CPSM.SEYUAUTH
*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD *
* If we TIMED out with an RC=4 then retry making MYAPP
* AVAILABLE.
*
SET CICSPLEX(MYPLEX);
*
SET APPLICATION(MYAPP)
VERSION(4.4.4)
PLATFORM(MYPLATFM)
STATE(AVAILABLE);
//*
// ENDIF