| .gitea/workflows | ||
| jcl | ||
| scripts | ||
| src | ||
| .gitignore | ||
| HERCULES_READER_COMMANDS.md | ||
| newjob.sh | ||
| pyproject.toml | ||
| README.MD | ||
TK5 C90 Projects
A modern development workflow for C90 programming on IBM MVS 3.8j TK5, combining contemporary tooling with mainframe execution.
Overview
This project enables C90 (ANSI C89) development for MVS 3.8j using modern IDEs and Git workflows. Source code is written locally, then automatically uploaded and compiled on the mainframe via CI/CD automation.
How It Works
- Local Development: Write C90 code in your IDE with modern editing features
- Git Push: Commit and push changes to the repository
- Automated Workflow: Gitea Actions triggers mainframe operations:
- Uploads source files to PDS members via netcat to the JES card reader
- Submits JCL jobs for compilation and execution
- Polls for job completion and retrieves output
- Archives job output as build artifacts (PDFs)
- Sync Management: Deleted files are automatically removed from the mainframe PDS
Architecture
Directory Structure
.
├── .gitea/workflows/ # CI/CD workflow definitions
│ ├── mvs_submit.yaml # Upload and execute workflow
│ └── mvs_delete.yaml # PDS member deletion workflow
├── scripts/ # Python automation scripts
│ ├── submit_job.py # Upload source & submit JCL
│ ├── del_member.py # Delete PDS members
│ └── poll_job.py # Poll for job completion
├── src/ # C90 source files
├── jcl/ # JCL job control files
└── tmp/ # Temporary files for workflow execution
Workflows
MVS Submit & Execute (mvs_submit.yaml)
- Triggers: Push to master with changes in
src/orjcl/ - Actions:
- Detects changed
.cor.basfiles - Uploads source to
@05054.SRCLIB.C(MEMBER) - Submits corresponding JCL from
jcl/directory - Polls for job completion (120s timeout)
- Downloads and archives job output PDF
- Detects changed
MVS Delete Members (mvs_delete.yaml)
- Triggers: Push to master with deletions in
src/orjcl/, or manual dispatch - Actions:
- Detects deleted
.cor.basfiles - Submits IEHPROGM jobs to delete corresponding PDS members
- Keeps mainframe PDS in sync with repository
- Detects deleted
Scripts
submit_job.py
- Uploads source files to MVS PDS using IEBUPDTE
- Submits JCL jobs via netcat to port 3505 (JES card reader)
- Handles PDS member creation and updates
del_member.py
- Deletes PDS members using IEHPROGM utility
- Maintains sync between repository and mainframe storage
poll_job.py
- Monitors job completion via MVS console
- Retrieves job output from remote printout directory
- Downloads PDF output for archival
Requirements
Mainframe
- MVS 3.8j TK5 system accessible via network
- JES card reader port (default: 3505)
- User account with appropriate permissions
CI/CD Environment
- Gitea with Actions enabled
- Ubuntu runner with:
netcat-traditional- Python 3 with
requestslibrary
Configuration Variables
Set in Gitea repository settings:
Variables:
MVS_BATCH_PASSWORD: Password for batch job submissionMVS_CONSOLE_URL: URL for MVS console accessMVS_CONSOLE_USER: Console usernameLINODE_SSH_HOST: SSH host for printout retrievalLINODE_PRINTOUT_DIR: Remote directory for job output
Secrets:
MVS_CONSOLE_PASSWORD: Console password
Usage
Adding New Programs
- Create source file in
src/(e.g.,HELLO.c) - Create corresponding JCL in
jcl/(e.g.,HELLO.jcl) - Commit and push:
git add src/HELLO.c jcl/HELLO.jcl git commit -m "Add HELLO program" git push - Workflow automatically uploads and executes
- Download job output from build artifacts
Removing Programs
Simply delete the source file and push:
git rm src/OLDPROG.c
git commit -m "Remove OLDPROG"
git push
The deletion workflow automatically removes @05054.SRCLIB.C(OLDPROG) from the mainframe.
Manual Cleanup
Trigger the deletion workflow manually via Gitea UI to clean up orphaned PDS members.
Technical Details
Upload Process
Source files are uploaded using JCL with IEBUPDTE:
- Python script generates upload JCL dynamically
- JCL includes
./ ADD NAME=MEMBERcontrol statements - Source lines are padded to 80 characters (LRECL=80)
- Comment lines starting with
//or/*are stripped to avoid JCL conflicts - Submitted via netcat to JES internal reader
Deletion Process
PDS members are deleted using IEHPROGM:
//DELMEM EXEC PGM=IEHPROGM
//DD1 DD DSN=dataset,DISP=SHR
//SYSIN DD *
DELETE DSNAME=dataset,MEMBER=member
Job Monitoring
Polls MVS console for job completion, then retrieves PDF output via SSH from remote printout directory.
Development Notes
This project serves as a learning environment for:
- C90/ANSI C89 programming
- MVS JCL and utilities (IEBUPDTE, IEHPROGM)
- Mainframe batch processing workflows
- CI/CD integration with legacy systems
- Network protocols for mainframe communication
License
Educational/personal use project.