IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Structured Data and Nested Loops via “The 12 Days of Xmas"


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manyone

New User


Joined: 09 Mar 2006
Posts: 21

PostPosted: Thu Dec 04, 2025 5:12 am
Reply with quote

I’ve posted a COBOL program that implements all twelve verses of “The Twelve Days of Christmas” using classic mainframe techniques—intended as a compact illustration of:

Tabular data handling with OCCURS and REDEFINES
Ordinal suffix generation (1st, 2nd, 3rd, etc.) via compact encoded literals
Bidirectional loop logic: the inner loop descends from the current day to day 1, mimicking cumulative look-back patterns common in period-to-date reporting (e.g., year-end inventory reconciliation)

The logic is implemented in two flavors:

GnuCOBOL (for PC development/testing)
COBOL-74 (fully compatible with MVS/TSO environments like TK4-)

Includes JCL for compile-and-go in TK4-, and uses only standard COBOL features—no external files or nonportable extensions.

🔗 GitHub: github.com/manyone/cobol-twelve-days
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Alternate key data extracttion COBOL Programming 13
No new posts COBOL Infinite loops COBOL Programming 7
No new posts db2 vs static data COBOL Programming 1
No new posts External data queue (changes?) CLIST & REXX 0
No new posts Pull data using date difference betwe... DB2 6
Search our Forums:


Back to Top