Automating CICS NEWCOPY and PHASEIN in Git CI/CD Pipelines with Zowe CLI
Executive Summary: Automating CICS NEWCOPY and PHASEIN in Git CI/CD Pipelines with Zowe CLI
Manual CEMT SET PROGRAM NEWCOPY commands slow deployment velocity and introduce human error. Learn how to securely automate CICS NEWCOPY and PHASEIN via Zowe CLI and GitHub Actions, enabling zero-downtime application refresh upon Git pull request merge.
1 Problem Statement & Architecture Context: Automating CICS NEWCOPY and PHASEIN in Git CI/CD Pipelines with Zowe CLI
Mainframe application teams deploying COBOL/CICS changes manually log into 3270 green screens, navigate to CICS regions, and issue:
CEMT SET PROGRAM(ORDR01) NEWCOPY
In multi-region CICS configurations (AOR/TOR/DOR Sysplex), engineers frequently forget secondary regions, leading to version skew where users encounter stale code or AEIS abends. Furthermore, if the program is actively executing, NEWCOPY fails with INVREQ, disrupting deployments.
2 Technical Root Cause & Architecture Mechanics
NEWCOPY cannot refresh a program in storage if the current use count (USECOUNT) is greater than zero, or if tasks are suspended inside the module. In contrast, PHASEIN allows active tasks to finish executing the old copy while routing new transactions to the freshly loaded module in the DFHRPL concatenation. Manual execution across dozens of regions lacks concurrency control, audit logging, and automated rollback upon failure.
3 Implementation Guide & Modernization Strategy
# 1. Configure Zowe CICS Profile via Zowe CLI
Create a dedicated z/OSMF or CICS Management Client Interface (CMCI) profile:
zowe profiles create cics-profile cics_prod \
--host zos.production.corp \
--port 4443 \
--user PRODDEPLOY \
--password "$DEPLOY_TOKEN" \
--region-name CICS* \
--protocol https
# 2. Issue CICS PHASEIN Across All Target Regions
Execute cics refresh program using PHASEIN to guarantee zero transaction downtime:
# Refresh ORDR01 across all Application Owning Regions (AORs)
zowe cics refresh program ORDR01 \
--region-name "AOR*" \
--cics-profile cics_prod
The CLI returns JSON metadata confirming the load point, length, and timestamp of the new binary:
{
"response": "OK",
"program": "ORDR01",
"action": "PHASEIN",
"regions_updated": ["AOR01", "AOR02", "AOR03"],
"useCount": 0
}
# 3. Integrate into GitHub Actions / GitLab CI Pipeline
name: Deploy COBOL to CICS
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Zowe CLI
run: npm install -g @zowe/cli @zowe/cics-for-zowe-cli
- name: Deploy Binary & Refresh CICS
env:
ZOWE_OPT_USER: ${{ secrets.ZOS_DEPLOY_USER }}
ZOWE_OPT_PASSWORD: ${{ secrets.ZOS_DEPLOY_PWD }}
run: |
zowe zos-files upload file-to-data-set dist/ORDR01.load "PROD.CICS.LOADLIB(ORDR01)"
zowe cics refresh program ORDR01 --region-name "AOR*"
Technical Specifications Matrix
| Attribute | Specification |
|---|---|
| Target Environment | IBM z/OS • DevOps & Automation |
| Key Technologies | Zowe CLI, CICS TS, NEWCOPY |
| Delivery SLA | Accelerated Sprint Delivery via StackMF Pods |
| Technical Reviewer | Anshu, Chief Technology Architect • StackMF Architecture Pod |
Production Readiness & Verification Checklist
- Prefer `PHASEIN` over `NEWCOPY` for live production programs to avoid task locking.
- Verify that `RESSEC(NO)` or proper RACF permissions for the deploy service account exist in the CICS region.
- Incorporate automated post-deploy smoke tests using Zowe REST API mocks.
- Include CICS region discovery in pipeline scripts to automatically refresh newly provisioned regions.
? Frequently Asked Questions
What is the root cause of Automating CICS NEWCOPY and PHASEIN in Git CI/CD Pipelines with Zowe CLI? ↓
How do you resolve Automating CICS NEWCOPY and PHASEIN in Git CI/CD Pipelines with Zowe CLI in production? ↓
How can teams prevent Automating CICS NEWCOPY and PHASEIN in Git CI/CD Pipelines with Zowe CLI in enterprise pipelines? ↓
Recommended Technical Runbooks
Migrating from Broadcom Endevor to Git & Modern CI/CD using Zowe CLI and IBM DBB
Broadcom CA-7 / CA-11 Decoupling: Migrating 20,000+ JCL Batch Schedules to Stonebranch or Control-M
Building Enterprise REXX Automation: Scripting TSO/E, ISPF Panels, and SDSF Job Parsing
Authoritative Reference Documentation
Official IBM manuals, Redbooks, and vendor technical advisories:
This diagnostic runbook is published by StackMF Technologies LLP for educational and architectural reference only. All code snippets, JCL, and procedures are provided "AS IS" without warranty of any kind. Always test changes thoroughly in non-production sysplex environments prior to production rollout.
IBM, z/OS, CICS, Db2, IMS, RACF, and IDz are registered trademarks of International Business Machines Corporation. Broadcom, CA-7, and Endevor are trademarks of Broadcom Inc. All other trademarks belong to their respective owners and are referenced under the Nominative Fair Use Doctrine (US Lanham Act 15 U.S.C. ยง 1125 / Section 30 of the Indian Trade Marks Act, 1999) solely for technology compatibility and diagnostic identification. StackMF Technologies LLP is an independent consulting entity not affiliated with or endorsed by these vendors. View Full Legal & IP Policy →
Struggling with Critical Mainframe Incidents or Vendor Renewal Pressure?
StackMF deploys certified Senior Mainframe Engineers fluent in both z/OS legacy internals (COBOL, DB2, CICS, VSAM, CA-7, Endevor) and modern cloud stacks (React, Kafka, AWS, Git). Onboard dedicated pods in 48 hours or cut Broadcom licensing by 60%.