DevOps practices for CICS mainframe applications combine development and operations to automate the software delivery lifecycle. By implementing CI/CD pipelines, automated testing, version control, and modern tooling, organizations can deliver CICS applications faster, with higher quality, and improved reliability. Understanding DevOps practices is essential for modernizing CICS development while maintaining the security and stability that mainframe systems require.
DevOps for CICS is the integration of development and operations practices to automate and streamline the delivery of CICS applications. It encompasses version control, continuous integration, automated testing, continuous deployment, infrastructure automation, and monitoring. DevOps practices enable CICS development teams to deliver features and fixes more frequently while maintaining the reliability and security standards required for mainframe systems.
Key principles of DevOps for CICS:
Imagine you're building a LEGO castle. DevOps is like having helpers who automatically check if your LEGO pieces fit together (testing), put your castle in the right place when you're done (deployment), and keep track of all the changes you make (version control). Instead of doing everything by hand each time, these helpers do it automatically and quickly, so you can build more castles faster and make sure they're all built correctly!
Version control is the foundation of DevOps practices. All CICS source code, including COBOL programs, BMS maps, CICS resource definitions, and configuration files, should be stored in version control systems like Git. This enables code review, change tracking, collaboration, and the ability to roll back to previous versions.
CICS applications consist of multiple types of source code that should be version controlled:
1234567891011121314151617181920212223# Example Git repository structure for CICS application cics-application/ ├── src/ │ ├── cobol/ │ │ ├── CUSTINQ.cbl # Customer inquiry program │ │ ├── CUSTUPD.cbl # Customer update program │ │ └── CUSTVAL.cbl # Customer validation program │ ├── bms/ │ │ ├── CUSTINQ.bms # Customer inquiry map │ │ └── CUSTUPD.bms # Customer update map │ └── cics/ │ ├── programs.csd # Program definitions │ ├── transactions.csd # Transaction definitions │ └── files.csd # File definitions ├── tests/ │ ├── unit/ │ │ └── CUSTINQ_test.cbl # Unit tests │ └── integration/ │ └── customer_flow_test.cbl ├── scripts/ │ ├── build.sh # Build script │ └── deploy.sh # Deployment script └── README.md
Effective branching strategies enable parallel development while maintaining code quality:
123456789101112131415161718# Example Git workflow # Create feature branch git checkout -b feature/customer-search # Make changes and commit git add src/cobol/CUSTSRCH.cbl git commit -m "Add customer search functionality" # Push to remote git push origin feature/customer-search # Create pull request for code review # After approval, merge to develop branch git checkout develop git merge feature/customer-search # Deploy develop branch to test environment # After testing, merge to main for production
Continuous Integration involves automatically building and testing code whenever changes are committed to the version control system. For CICS applications, CI ensures that code compiles correctly, passes automated tests, and integrates properly with other components.
A typical CI pipeline for CICS includes these stages:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556# Example Jenkins CI pipeline for CICS (Jenkinsfile) pipeline { agent any stages { stage('Checkout') { steps { git branch: 'develop', url: 'https://github.com/company/cics-application.git' } } stage('Build') { steps { sh ''' # Compile COBOL programs cobolc -o CUSTINQ CUSTINQ.cbl cobolc -o CUSTUPD CUSTUPD.cbl # Assemble BMS maps asma -o CUSTINQ CUSTINQ.bms # Validate CICS resource definitions cicsdef validate programs.csd ''' } } stage('Unit Tests') { steps { sh ''' # Run automated unit tests zunit CUSTINQ_test.cbl ''' } } stage('Code Quality') { steps { sh ''' # Run static analysis sonar-scanner ''' } } stage('Package') { steps { sh ''' # Create deployment package tar -czf cics-app-BUILD_NUMBER.tar.gz CUSTINQ CUSTUPD CUSTINQ.bms programs.csd ''' } } } }
Automated testing is crucial for ensuring code quality and detecting issues early. For CICS applications, automated testing includes unit tests, integration tests, and functional tests that can run as part of the CI/CD pipeline.
IBM Z Open Unit Test enables automated unit testing for CICS COBOL programs. It supports environment-independent testing using stubs, allowing tests to run without requiring a full CICS environment.
1234567891011121314151617181920212223242526272829*> Example unit test for CICS program using Z Open Unit Test IDENTIFICATION DIVISION. PROGRAM-ID. CUSTINQ_TEST. AUTHOR. TEST FRAMEWORK. DATA DIVISION. WORKING-STORAGE SECTION. 01 TEST-CUSTOMER-ID PIC X(10) VALUE '1234567890'. 01 EXPECTED-NAME PIC X(30) VALUE 'JOHN DOE'. 01 ACTUAL-NAME PIC X(30). 01 TEST-RESULT PIC X(10). PROCEDURE DIVISION. MAIN-TEST. *> Test customer inquiry functionality CALL 'CUSTINQ' USING TEST-CUSTOMER-ID ACTUAL-NAME *> Assert expected result IF ACTUAL-NAME = EXPECTED-NAME MOVE 'PASS' TO TEST-RESULT DISPLAY 'TEST PASSED: Customer name matches' ELSE MOVE 'FAIL' TO TEST-RESULT DISPLAY 'TEST FAILED: Expected ' EXPECTED-NAME ' but got ' ACTUAL-NAME END-IF GOBACK.
Integration tests verify that CICS programs work correctly with other system components, such as databases, files, and other CICS programs. These tests typically run in a test CICS environment.
1234567891011121314151617181920# Example integration test script #!/bin/bash # Deploy to test CICS region zowe cics deploy program CUSTINQ --region TEST1 # Define transaction zowe cics define transaction CINQ --program CUSTINQ --region TEST1 # Run test transaction zowe cics run transaction CINQ --input "1234567890" --region TEST1 # Verify results if [ $? -eq 0 ]; then echo "Integration test passed" exit 0 else echo "Integration test failed" exit 1 fi
Continuous Deployment automates the deployment of tested code to various environments (development, test, production). For CICS, this involves deploying programs, defining resources, and updating configurations automatically.
A CD pipeline for CICS typically includes:
12345678910111213141516171819202122232425262728# Example deployment script using Zowe CLI #!/bin/bash ENVIRONMENT=$1 PROGRAM_NAME=$2 CICS_REGION=$3 echo "Deploying $PROGRAM_NAME to $ENVIRONMENT environment" # Deploy program zowe cics deploy program $PROGRAM_NAME --region $CICS_REGION --csd-group $ENVIRONMENT # Define program resource zowe cics define program $PROGRAM_NAME --region $CICS_REGION --csd-group $ENVIRONMENT # Install program zowe cics install program $PROGRAM_NAME --region $CICS_REGION # Verify deployment zowe cics get program $PROGRAM_NAME --region $CICS_REGION if [ $? -eq 0 ]; then echo "Deployment successful" exit 0 else echo "Deployment failed" exit 1 fi
Zowe is an open-source framework that provides APIs and tools for interacting with z/OS systems. For CICS DevOps, Zowe CLI and plugins enable automation of CICS operations from CI/CD pipelines and modern development environments.
The Zowe CLI CICS plugin provides commands for managing CICS resources and operations:
1234567891011121314151617# Install Zowe CLI CICS plugin zowe plugins install @zowe/cics-plugin # Deploy a program zowe cics deploy program CUSTINQ --region TEST1 --csd-group TEST # Define a transaction zowe cics define transaction CINQ --program CUSTINQ --region TEST1 --csd-group TEST # Install the transaction zowe cics install transaction CINQ --region TEST1 # Run a transaction for testing zowe cics run transaction CINQ --input "1234567890" --region TEST1 # Get program information zowe cics get program CUSTINQ --region TEST1
The Zowe API Mediation Layer provides REST APIs for z/OS services, enabling integration with modern tools and platforms. CICS applications can be managed through REST APIs, making them accessible from web-based tools and CI/CD platforms.
Jenkins is a popular CI/CD automation server that can be integrated with CICS development. The Zowe zDevOps Jenkins Plugin provides out-of-the-box integration for mainframe DevOps workflows.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859pipeline { agent any environment { CICS_REGION = 'TEST1' CSD_GROUP = 'TEST' } stages { stage('Build') { steps { sh ''' # Compile COBOL programs cobolc -o CUSTINQ CUSTINQ.cbl ''' } } stage('Test') { steps { sh ''' # Run unit tests zunit CUSTINQ_test.cbl ''' } } stage('Deploy to Test') { steps { sh ''' # Deploy using Zowe CLI zowe cics deploy program CUSTINQ --region CICS_REGION --csd-group CSD_GROUP zowe cics define program CUSTINQ --region CICS_REGION --csd-group CSD_GROUP zowe cics install program CUSTINQ --region CICS_REGION ''' } } stage('Integration Test') { steps { sh ''' # Run integration tests zowe cics run transaction CINQ --input "1234567890" --region CICS_REGION ''' } } } post { success { echo 'Pipeline succeeded' } failure { echo 'Pipeline failed' } } }
Infrastructure as Code (IaC) involves defining and managing CICS resources and configurations as code. This enables version control of infrastructure, consistent deployments, and the ability to recreate environments automatically.
CICS resource definitions (programs, transactions, files, etc.) should be stored as code in version control. These definitions can be deployed consistently across environments.
123456789101112131415161718192021222324252627# Example CICS resource definition file (CSD format) DEFINE PROGRAM(CUSTINQ) GROUP(TEST) DESCRIPTION('Customer Inquiry Program') LANGUAGE(COBOL) STATUS(ENABLED) RESIDENT(NO) USAGE(NORMAL) RENT(NOPROTECT) EXECKEY(USER) DATALOCATION(ANY) DATALOCATION(ANY) DEFINE TRANSACTION(CINQ) GROUP(TEST) DESCRIPTION('Customer Inquiry Transaction') PROGRAM(CUSTINQ) TASKCLASS(DFHTASK) TASKPRIORITY(5) STATUS(ENABLED) TRANCLASS(DFHTRAN) SPURGE(YES) TPURGE(YES) RTRANSID(CICS) RTERMID(CICS) RTIMOUT(0) DTIMOUT(0) RTIMOUT(0) DTIMOUT(0)
Begin with automating a single process (e.g., builds or deployments) and gradually expand. Don't try to automate everything at once. Start with the most painful or error-prone processes.
Store all source code, configurations, scripts, and resource definitions in version control. This provides a complete history, enables collaboration, and allows rollback if needed.
Implement automated testing at multiple levels: unit tests, integration tests, and functional tests. Run tests automatically as part of the CI pipeline to catch issues early.
Promote code through environments (dev → test → production) rather than deploying directly to production. Each environment should mirror production as closely as possible.
Require code review before merging to main branches. Code review improves quality, shares knowledge, and ensures coding standards are followed.
Monitor deployment success rates, build times, test results, and application performance. Use metrics to identify bottlenecks and improve processes.
Document your DevOps processes, pipeline configurations, and deployment procedures. This enables knowledge sharing and onboarding of new team members.
Developers create feature branches for new functionality. Changes are tested in CI, reviewed, and merged to develop. After testing in test environment, code is promoted to production.
123456789101112131415161718192021222324# Feature branch workflow 1. Create feature branch from develop git checkout -b feature/new-functionality 2. Develop and commit changes git commit -m "Add new functionality" 3. Push and create pull request git push origin feature/new-functionality 4. CI pipeline runs automatically - Build - Test - Code quality checks 5. Code review and approval 6. Merge to develop branch 7. Deploy to test environment 8. After testing, merge to main 9. Deploy to production
Maintain two identical CICS environments (blue and green). Deploy new versions to the inactive environment, test, then switch traffic. This enables quick rollback by switching back.
Deploy new versions to a small subset of users or transactions first. Monitor for issues, then gradually roll out to all users if successful. This reduces risk of widespread issues.
| Tool | Purpose | Use Case |
|---|---|---|
| Git | Version control | Store and manage source code, track changes, enable collaboration |
| Jenkins | CI/CD automation | Automate builds, tests, and deployments |
| Zowe CLI | Mainframe integration | Interact with CICS from command line and scripts |
| IBM Z Open Unit Test | Automated testing | Run unit tests for COBOL programs |
| SonarQube | Code quality | Static code analysis, code quality metrics |
| z/OSMF | Infrastructure management | Automate z/OS and CICS resource provisioning |
| Docker | Containerization | Create consistent development and test environments |
| Ansible | Configuration management | Automate CICS configuration and deployment |
Problem: Existing manual processes and cultural resistance to change.
Solution: Start with small, visible wins. Demonstrate value through faster delivery and fewer errors. Gradually expand automation as teams see benefits.
Problem: Mainframe tools may not integrate easily with modern DevOps tools.
Solution: Use Zowe to bridge the gap. Zowe provides APIs and CLI tools that enable integration with modern CI/CD platforms and development tools.
Problem: CICS applications may have complex dependencies making testing difficult.
Solution: Use stubs and mocks for dependencies. Implement environment-independent testing where possible. Use test environments that mirror production.
DevOps practices for CICS enable organizations to modernize mainframe development while maintaining reliability and security. Key points to remember:
By implementing DevOps practices, CICS development teams can deliver applications faster, with higher quality, and improved collaboration between development and operations.
1. What is the primary goal of DevOps practices for CICS?
2. What is Zowe used for in CICS DevOps?
3. What is included in a typical CI/CD pipeline for CICS?
4. Why is automated testing important in CICS DevOps?
5. How does version control benefit CICS development?
Learn about implementing continuous integration and continuous deployment pipelines specifically for CICS applications
Understanding testing approaches, frameworks, and best practices for CICS applications
Learn about version control practices, branching strategies, and change management for CICS development
Understanding how to package CICS applications for deployment and manage application artifacts