Skip to content

Commit 99f59c7

Browse files
committed
Add unemplyoment claims challenge
Signed-off-by: Jessielaine Punongbayan <[email protected]>
1 parent 486b948 commit 99f59c7

File tree

7 files changed

+117
-21
lines changed

7 files changed

+117
-21
lines changed

COBOL Programming Course #2 - Advanced Topics/COBOL Programming Course #2 - Advanced Topics.md

Lines changed: 117 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,53 +57,149 @@ Here are the instructions:
5757

5858
- Extract the response from this API: https://api.covid19api.com/summary. You will receive a JSON file that is similar to the photo below:
5959

60-
![](Images/cobolchCOV19-img1.png)
60+
![](Images/cobolchCOV19-img1.png)
6161

6262
- Convert that file to CSV format. It should look like this. In my example, I only chose the “Countries” part.
6363

64-
![](Images/cobolchCOV19-img2.png)
64+
![](Images/cobolchCOV19-img2.png)
6565

6666
- Using Zowe, Upload the CSV file that you have created to mainframe.
6767

68-
`Hint: you can use the command zowe files ul ftds “file location” “dataset name”`
68+
`Hint: you can use the command zowe files ul ftds “file location” “dataset name”`
6969

7070
- Create a new member in your *.CBL Dataset to write your COBOL program.
7171

72-
`Hint: This step can be done using Zowe Explorer and Zowe CLI`
72+
`Hint: This step can be done using Zowe Explorer and Zowe CLI`
7373

7474
- Begin writing your COBOL program
7575

7676
- In your COBOL program, you have to read the uploaded CSV file and re-format it to display the contents like this:
7777

78-
```
79-
********************************************************************
80-
DATE: 2020-04-22
81-
TIME: T16:54:5
82-
COUNTRY: "Antigua and Barbuda"
83-
COUNTRY CODE: "AG"
84-
SLUG: "antigua-and-barbuda"
85-
NEW CONFIRMED CASES: 00000
86-
TOTAL CONFIRMED CASES: 00023
87-
NEW DEATHS: 00000
88-
TOTAL DEATHS: 00003
89-
NEW RECOVERIES: 00004
90-
TOTAL RECOVERIES: 00007
91-
********************************************************************
92-
```
78+
```
79+
********************************************************************
80+
DATE: 2020-04-22
81+
TIME: T16:54:5
82+
COUNTRY: "Antigua and Barbuda"
83+
COUNTRY CODE: "AG"
84+
SLUG: "antigua-and-barbuda"
85+
NEW CONFIRMED CASES: 00000
86+
TOTAL CONFIRMED CASES: 00023
87+
NEW DEATHS: 00000
88+
TOTAL DEATHS: 00003
89+
NEW RECOVERIES: 00004
90+
TOTAL RECOVERIES: 00007
91+
********************************************************************
92+
```
9393
9494
- Optional: A more advance approach is to reformat it into a Report Form like this:
9595
96-
![](Images/cobolchCOV19-img3.png)
96+
![](Images/cobolchCOV19-img3.png)
9797
9898
- Compile and Test your work
9999
100100
- Optional: Automate. Using NPM and Zowe CLI, Run all these steps and create a “one click” COBOL build similar to this.
101101
102-
![](Images/cobolchCOV19-img4.gif)
102+
![](Images/cobolchCOV19-img4.gif)
103103
104104
I hope this could be a good COBOL challenge to anybody who is willing to try.
105105
If you want to check the solution, read all about it [here](https://medium.com/@jessielaine.punongbayan/solution-covid-19-reports-cobol-challenge-6c509579e3fe?source=friends_link&sk=5a662034a03c91d639b77267ed6abfc9).
106106
107107
Happy Coding! 😉
108108
109109
_Disclaimer: This challenge is also posted in [Medium.com](https://medium.com/@jessielaine.punongbayan/cobol-challenge-covid-19-reports-ee03a946bd23)._
110+
111+
# COBOL Challenge - The Unemployment Claims
112+
113+
Let us go to a more advanced challlenge! Your task is to create an end-to-end solution. That means that our end goal is to build an application that will fire Zowe APIs to Mainframe and display the result in the application. This is how the flow would look like:
114+
115+
![](Images/cobolchClaims-img1.png)
116+
117+
_Of course, you do not have to complete the whole challenge if you do not want to. But it would be great if you do_ 😉
118+
119+
### Our Data
120+
121+
The data that we are going to use will come from https://www.data.gov/. According to their website, this is a repository of data that is available for public use. For more information, please visit their website.
122+
123+
To be more specific, we are going to get “The Monthly Unemployment Claims of the State of Missouri”.
124+
I chose this because it is separated according to different categories:
125+
126+
- **By Age:** https://catalog.data.gov/dataset/missouri-monthly-unemployment-claims-by-age-d20a7
127+
- **By Ethnicity:** https://catalog.data.gov/dataset/missouri-monthly-unemployment-claims-by-ethnicity-2a03b
128+
- **By Industry:** https://catalog.data.gov/dataset/missouri-monthly-unemployment-claims-by-industry-80e86
129+
- **By Race:** https://catalog.data.gov/dataset/missouri-monthly-unemployment-claims-by-race-32ab3
130+
- **By Gender:** https://catalog.data.gov/dataset/missouri-monthly-unemployment-claims-by-sex-f5cb6
131+
132+
You can consume the data in different formats such as CSV, RDF, JSON or XML. You can choose whatever format you like.
133+
134+
### Use Case
135+
136+
You are given a new set of data for The Unemployment Claims. Your tasks are as follows:
137+
138+
- To create a new database for the new set of data and combine them based on Record ID.
139+
- To provide a way for other COBOL programs and other applications to access this newly created database
140+
- To create a report specifying all the information available in the newly created database. The report will contain, but not limited to, the following information: Record ID, Age, Ethnicity, Industry, Race and Gender.
141+
142+
### Instructions
143+
144+
- Let’s create a database. This can be done in various ways but the easiest one the I could think of is a VSAM file. Create a COBOL program that will consume your data. Using the RECORD-ID as the key (which is more visible when reading the CSV file), create a KSDS VSAM file and store all the information there.
145+
146+
_What this means is that, one record will have the RECORD-ID as the key and added to it are all the information from The Monthly Unemployment Claims (Fields from Age, Ethnicity, Industry, Race and Gender) will be added or connected to the RECORD-ID._
147+
148+
The flow would look like this:
149+
150+
![](Images/cobolchClaims-img2.png)
151+
152+
- Create a COBOL sub-routine. This program will allow other programs to read the data from the VSAM file. This sub-routine should be able to do the following scenario:
153+
154+
- accepts requests to get information of a specific record ID.
155+
- _(Optional)_ accepts requests to get information of all the records inside the database. What does this mean? It means that instead of providing a record ID, I could provide an indicator the I want to create a report of all the records inside the database.
156+
157+
![](Images/cobolchClaims-img3.png)
158+
159+
_The purpose of the COBOL sub-routine is to allow other COBOL programs or other application to access the information inside the VSAM file._
160+
161+
- Create a Main COBOL Program. This program will create a report based on the records inside the newly created database. The process is as follows:
162+
163+
- It should call the COBOL sub-routine passing the Record ID or (Optional) an indicator that you want to print all records in the database.
164+
- It should receive the response from the sub-routine.
165+
- It should process the response and generate a report. This report can be a formal report or just a display in the SYSOUT. It’s up to you.
166+
167+
The flow should look like this:
168+
169+
![](Images/cobolchClaims-img4.png)
170+
171+
- Create your JCLs.
172+
173+
_By this point, if you choose to do the exercise using COBOL programs only, you should be able to read the data from your VSAM file, process it and generate a report. The generated report could be an information of a specific record or multiple records._
174+
175+
- _(Optional)_ Create an application. It can be different applications like a Mobile App, a Web App or an Electron App. It is up to you. In this application you should be able to view a record by providing a RECORD-ID. The flow would be similar to Step #3.
176+
177+
This is an example of a possible design of the application:
178+
179+
![](Images/cobolchClaims-img5.png)
180+
181+
```
182+
Hint: How can I accomplish this? By using the Zowe CLI NPM package, you can fire Zowe APIs that will submit your JCLs and get the results. From there, you can view the output and display it in your application. This article can provide a good example.
183+
184+
What APIs am I going to use? You will use the Jobs Submit API and View Jobs Spool or View Dataset API. For more information, please visit [this site](https://docs.zowe.org/stable/web_help/index.html).
185+
```
186+
187+
- _(Optional)_ Create a CI/CD process that will create a nightly build of your application. [This article](https://medium.com/modern-mainframe/beginners-guide-cobol-made-easy-leveraging-open-source-tools-eb4f8dcd7a98?source=friends_link&sk=443517b1feaba8e392f5807246c25ca4) can help explain that process.
188+
189+
Sample CI/CD Build using CircleCI:
190+
191+
![](Images/cobolchClaims-img6.gif)
192+
193+
### Craving for more programming challenge?
194+
195+
Add more functionality to your COBOL Sub-routine like:
196+
197+
- Insert a new record
198+
- Update an existing record
199+
- Delete an existing record
200+
201+
I hope that by taking this challenge, you will be able to learn something new!
202+
203+
Happy Coding! 😉
204+
205+
_Disclaimer: This challenge is also posted in [Medium.com](https://medium.com/@jessielaine.punongbayan/zowe-cobol-challenge-the-unemployment-claims-2e35a42eabaa)._
15.9 KB
Loading
15 KB
Loading
11.5 KB
Loading
18.1 KB
Loading
62.8 KB
Loading
6.66 MB
Loading

0 commit comments

Comments
 (0)