You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: COBOL Programming Course #2 - Learning COBOL/COBOL Programming Course #2 - Learning COBOL.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2726,6 +2726,53 @@ This lab requires two COBOL programs, CBL0006 and CBL0007, and two respective JC
2726
2726
2727
2727

2728
2728
2729
+
2730
+
## Additional Exercise: Modify the Program to Count Clients from Another State
2731
+
2732
+
This exercise builds upon the existing COBOL program `CBL0006` and its corresponding JCL job `CBL0006J`. In the original program, logic was implemented to count clients from **Virginia** and display the total at the end of the report.
2733
+
2734
+
This exercise challenges you to modify the program to count clients from a different state instead of Virginia.
2735
+
2736
+
#### Objective
2737
+
2738
+
Your task is to understand how the current logic works in `CBL0006` to count clients from Virginia, and then modify the program to count clients from another state, such as **New York**.
2739
+
2740
+
**Prerequisites:** First examine `id.DATA` to identify available states. Use exact spelling and formatting.
2741
+
2742
+
#### Instructions
2743
+
2744
+
1.**Analyze the current implementation**
2745
+
- Locate the Virginia state-checking condition in `CBL0006`
2746
+
- Find where the client count is updated and displayed
2747
+
2748
+
2.**Modify `CBL0006`**
2749
+
- Replace Virginia logic with your chosen state
2750
+
- Update paragraph names, variables, and output display
2751
+
2752
+
**Note:** Multiple program sections require updates, not just the state name.
2753
+
2754
+
3.**Test your changes**
2755
+
- Save and submit `CBL0006J`
2756
+
- Verify successful compilation and correct output count
2757
+
2758
+
**Expected Output:** If you chose New York, the final line of your report should display:
2759
+
2760
+

2761
+
2762
+
2763
+
#### Lab Hints
2764
+
2765
+
- Update WORKING-STORAGE variables, paragraph names, and output formatting
2766
+
- Follow COBOL naming conventions
2767
+
- Verify your chosen state exists in `id.DATA`
2768
+
- Consider state name length for proper output formatting
2769
+
2770
+
#### Learning Objectives
2771
+
2772
+
This exercise develops skills in COBOL conditional processing, program structure analysis, and consistent code modification. The goal is building analytical abilities for reading and modifying existing COBOL programs, essential for legacy system maintenance.
2773
+
2774
+
**Need Help?** If you encounter difficulties, you can refer to the complete solution code `CBL0006C` available on the project’s [GitHub](https://github.com/openmainframeproject/cobol-programming-course/tree/master/COBOL%20Programming%20Course%20%233%20-%20Advanced%20Topics/Challenges/Debugging/cbl) repository.
0 commit comments