Implement calendar subroutine for day-of-week and holiday detection in AS400 COBOL #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a comprehensive calendar sub function for AS400 COBOL that determines the day of the week for any given date and identifies recognized holidays. The solution addresses the need for calendar functionality in COBOL applications with a robust, reusable subroutine.
What's New
Core Calendar Subroutine (
CALENDAR.CBLLE)A callable COBOL subroutine that provides:
The subroutine uses COBOL intrinsic functions (
INTEGER-OF-DATE,MOD) for accurate date calculations following standard calendar algorithms.Interactive Calendar Application (
CALAPPS.CBLLE)A menu-driven application that demonstrates the subroutine's capabilities:
Comprehensive Test Suite (
TESTCAL.CBLLE)Automated and interactive testing that validates:
Usage Example
Technical Details
The implementation follows AS400 COBOL standards with:
.CBLLEfile format in theQCBLLESRCdirectoryThe calendar subroutine can be easily extended to support additional holidays or enhanced date functionality as needed by applications.
Files Added
AS400/QCBLLESRC/CALENDAR.CBLLE- Core calendar subroutineAS400/QCBLLESRC/CALAPPS.CBLLE- Interactive calendar applicationAS400/QCBLLESRC/TESTCAL.CBLLE- Comprehensive test suiteAS400/QCBLLESRC/EXAMPLE.CBLLE- Simple usage demonstrationdocs/CALENDAR-SUBROUTINE-README.md- Complete documentation and API referenceThis calendar subroutine provides essential date functionality for COBOL applications and serves as a foundation for more advanced calendar features.
Fixes #3
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.