COBOL Challenge: Covid-19 Reports

Jessielaine Punongbayan
3 min readApr 22, 2020

--

Now that the COBOL community is growing, I would like to create some programming challenges that will help everyone in their learning.

It will be simple challenges that will allow you to practice what you have learned so far.

Photo by Markus Spiske on Unsplash

Our Goal

Since we are on a pandemic, the goal that I have set for this challenge is to create a COVID-19 Summary Report. The reports will come from the COVID19API website.

Pre-requisites:

Let’s Start

So here are the instructions:

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

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

Hint: If you are stuck in Step # 1 and Step # 2, I can provide the data for you.

3. Using Zowe, Upload the CSV file that you have created to mainframe.

Hint: you can use the command zowe files ul ftds “file location” “dataset name”

  • Create a new member in your *.CBL Dataset to write your COBOL program

Hint: This step can be done using Zowe Explorer and Zowe CLI

4. Begin writing your COBOL program

Hint: You can use my COBOL Generator or you can copy an existing program and change it.

  • In your COBOL program, you have to read the uploaded file from Step # 3 and re-format it to display the contents like this:
********************************************************************DATE: 2020-04-22TIME: T16:54:5COUNTRY: "Antigua and Barbuda"COUNTRY CODE: "AG"SLUG: "antigua-and-barbuda"NEW CONFIRMED CASES: 00000TOTAL CONFIRMED CASES: 00023NEW DEATHS: 00000TOTAL DEATHS: 00003NEW RECOVERIES: 00004TOTAL RECOVERIES: 00007********************************************************************
  • Optional: A more advance approach is to reformat it into a Report Form like this:

5. Compile and Test your work

6. Optional: Automate. Using NPM and Zowe CLI, Run all these steps and create a “one click” COBOL build similar to this.

I hope this could be a good COBOL challenge to anybody who is willing to try.

If you want to check my solution, read all about it here. Happy Coding! 😉

If you want to know more, I have included below the links about Zowe and Open Mainframe Project.

Also, here are the links for my Beginner’s Guide: COBOL Made Easy articles

--

--

Jessielaine Punongbayan

Art and tech enthusiast. As an artist and software engineer, I write about the intersection of creativity and technology. Sharing insights and experiences.