Skip to content

Commit 69b0c72

Browse files
committed
Adding Covid-19 Challenge
Signed-off-by: Jessielaine Punongbayan <[email protected]>
1 parent 41e101a commit 69b0c72

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed

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

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,61 @@ Clearly, Mari’s changes to the program that generates the reports have broken
4747

4848
Can you fix the code to get the correct result? The new source code is named **CBL0106** and the JCL is **CBL0106J**. In case you get stuck, the solution is in the file **CBL0106C**.
4949

50-
You can find them in the github repository for the COBOL course, in the subfolder **/COBOL Programming Course #2 - Advanced Topics/Challenges/Debugging**.
50+
You can find them in the github repository for the COBOL course, in the subfolder **/COBOL Programming Course #2 - Advanced Topics/Challenges/Debugging**.
51+
52+
# COBOL Challenge - The Covid 19 Reports
53+
54+
Today, you are tasked to create a COVID-19 Summary Report of all the countries around the world. The information will come from COVID19API website.
55+
56+
Here are the instructions:
57+
58+
- Extract the response from this API: https://api.covid19api.com/summary. You will receive a JSON file that is similar to the photo below:
59+
60+
![](Images/cobolchCOV19-img1.png)
61+
62+
- Convert that file to CSV format. It should look like this. In my example, I only chose the “Countries” part.
63+
64+
![](Images/cobolchCOV19-img2.png)
65+
66+
- Using Zowe, Upload the CSV file that you have created to mainframe.
67+
68+
`Hint: you can use the command zowe files ul ftds “file location” “dataset name”`
69+
70+
- Create a new member in your *.CBL Dataset to write your COBOL program.
71+
72+
`Hint: This step can be done using Zowe Explorer and Zowe CLI`
73+
74+
- Begin writing your COBOL program
75+
76+
- In your COBOL program, you have to read the uploaded CSV file and re-format it to display the contents like this:
77+
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+
```
93+
94+
- Optional: A more advance approach is to reformat it into a Report Form like this:
95+
96+
![](Images/cobolchCOV19-img3.png)
97+
98+
- Compile and Test your work
99+
100+
- Optional: Automate. Using NPM and Zowe CLI, Run all these steps and create a “one click” COBOL build similar to this.
101+
102+
![](Images/cobolchCOV19-img4.gif)
103+
104+
I hope this could be a good COBOL challenge to anybody who is willing to try.
105+
If you want to check my solution, read all about it [here](https://medium.com/@jessielaine.punongbayan/solution-covid-19-reports-cobol-challenge-6c509579e3fe?source=friends_link&sk=5a662034a03c91d639b77267ed6abfc9).
106+
107+
Happy Coding! 😉
78.7 KB
Loading
249 KB
Loading
14.3 KB
Loading
4.74 MB
Loading

0 commit comments

Comments
 (0)