Skip to content

Commit 4a351a4

Browse files
authored
Merge pull request #148 from openmainframeproject/Challenge-Covid-19
Challenge Covid-19 Reports
2 parents c206796 + 0dddd0f commit 4a351a4

File tree

5 files changed

+63
-1
lines changed

5 files changed

+63
-1
lines changed

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

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,66 @@ 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, using information from the COVID19API website.
55+
56+
## 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 image 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 to the mainframe.
67+
68+
**Hint:** You can use the command `zowe files ul ftds “file location” “dataset name”` to upload the CSV file to the mainframe.
69+
70+
- Create a new member in your *.CBL data set to write your COBOL program.
71+
72+
**Hint:** You can create a member using Zowe Explorer or Zowe CLI.
73+
74+
- Write a COBOL program that reads the uploaded CSV file and reformats it to display the contents like this:
75+
76+
```
77+
********************************************************************
78+
DATE: 2020-04-22
79+
TIME: T16:54:5
80+
COUNTRY: "Antigua and Barbuda"
81+
COUNTRY CODE: "AG"
82+
SLUG: "antigua-and-barbuda"
83+
NEW CONFIRMED CASES: 00000
84+
TOTAL CONFIRMED CASES: 00023
85+
NEW DEATHS: 00000
86+
TOTAL DEATHS: 00003
87+
NEW RECOVERIES: 00004
88+
TOTAL RECOVERIES: 00007
89+
********************************************************************
90+
```
91+
92+
- Compile and test your work.
93+
94+
## Advanced Tasks
95+
96+
If you want a more challenging approach, try the optional tasks below:
97+
98+
- Reformat the data into a Report Form like this:
99+
100+
![](Images/cobolchCOV19-img3.png)
101+
102+
- Automate. Using NPM and Zowe CLI, run all these steps and create a “one click” COBOL build similar to this:
103+
104+
![](Images/cobolchCOV19-img4.gif)
105+
106+
## Solution
107+
108+
To check the solution, refer to the blog post [here](https://medium.com/@jessielaine.punongbayan/solution-covid-19-reports-cobol-challenge-6c509579e3fe?source=friends_link&sk=5a662034a03c91d639b77267ed6abfc9).
109+
110+
Happy Coding! 😉
111+
112+
_Disclaimer: This challenge is also posted in [Medium.com](https://medium.com/@jessielaine.punongbayan/cobol-challenge-covid-19-reports-ee03a946bd23)._
78.7 KB
Loading
249 KB
Loading
14.3 KB
Loading
4.74 MB
Loading

0 commit comments

Comments
 (0)