Skip to content

Commit ddc0084

Browse files
authored
Merge branch 'master' into patch-1
2 parents 8f7f185 + a73ef11 commit ddc0084

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

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

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,29 @@ Can you fix the code to get the correct result? The new source code is named **C
4949

5050
You can find them in the github repository for the COBOL course, in the subfolder **/COBOL Programming Course #2 - Advanced Topics/Challenges/Debugging**.
5151

52-
# COBOL Challenge - The COVID-19 Reports
52+
## COBOL Challenge - The COVID-19 Reports
5353

5454
Today, you are tasked to create a COVID-19 Summary Report of all the countries around the world, using information from the COVID19API website.
5555

56-
## Instructions
56+
### Instructions
5757

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:
58+
1. Extract the response from this API: https://api.covid19api.com/summary. You will receive a JSON file that is similar to the image below:
5959

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

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

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

66-
- Using Zowe, upload the CSV file to the mainframe.
66+
3. Using Zowe, upload the CSV file to the mainframe.
6767

6868
**Hint:** You can use the command `zowe files ul ftds “file location” “dataset name”` to upload the CSV file to the mainframe.
6969

70-
- Create a new member in your *.CBL data set to write your COBOL program.
70+
4. Create a new member in your *.CBL data set to write your COBOL program.
7171

7272
**Hint:** You can create a member using Zowe Explorer or Zowe CLI.
7373

74-
- Write a COBOL program that reads the uploaded CSV file and reformats it to display the contents like this:
74+
5. Write a COBOL program that reads the uploaded CSV file and reformats it to display the contents like this:
7575

7676
```
7777
********************************************************************
@@ -89,9 +89,9 @@ Today, you are tasked to create a COVID-19 Summary Report of all the countries a
8989
********************************************************************
9090
```
9191
92-
- Compile and test your work.
92+
6. Compile and test your work.
9393
94-
## Advanced Tasks
94+
### Advanced Tasks
9595
9696
If you want a more challenging approach, try the optional tasks below:
9797
@@ -103,17 +103,17 @@ If you want a more challenging approach, try the optional tasks below:
103103
104104
![](Images/cobolchCOV19-img4.gif)
105105
106-
## Solution
106+
### Solution
107107
108108
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).
109109
110110
Happy Coding! 😉
111111
112112
_Disclaimer: This challenge is also posted in [Medium.com](https://medium.com/@jessielaine.punongbayan/cobol-challenge-covid-19-reports-ee03a946bd23)._
113113
114-
# COBOL Challenge - The Unemployment Claims
114+
## COBOL Challenge - The Unemployment Claims
115115
116-
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:
116+
Now let's try a more advanced challenge! Your task is to create an end-to-end solution. Our end goal is to build an application that will fire Zowe APIs to the mainframe and display the result in the application. This is how the flow would look:
117117
118118
![](Images/cobolchClaims-img1.png)
119119
@@ -123,7 +123,7 @@ _Of course, you do not have to complete the whole challenge if you do not want t
123123
124124
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.
125125
126-
To be more specific, we are going to get “The Monthly Unemployment Claims of the State of Missouri.
126+
To be more specific, we are going to get the monthly unemployment claims of the state of Missouri.
127127
I chose this because it is separated according to different categories:
128128
129129
- **By Age:** https://catalog.data.gov/dataset/missouri-monthly-unemployment-claims-by-age-d20a7
@@ -138,61 +138,59 @@ You can consume the data in different formats such as CSV, RDF, JSON or XML. You
138138
139139
You are given a new set of data for The Unemployment Claims. Your tasks are as follows:
140140
141-
- To create a new database for the new set of data and combine them based on Record ID.
142-
- To provide a way for other COBOL programs and other applications to access this newly created database
143-
- 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+
- To create a new database for the new set of data and combine the data based on the Record ID field.
142+
- To provide a way for other COBOL programs and other applications to access this newly created database.
143+
- To create a report specifying all the information available in the newly created database. The report will contain, but not be limited to, the following information: Record ID, Age, Ethnicity, Industry, Race and Gender.
144144
145145
### Instructions
146146
147-
- 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.
147+
1. Create a database. This can be done in various ways but the easiest one the I could think of is a VSAM file. First, create a COBOL program that will consume your data. Then, 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.
148148
149-
_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._
149+
_What this means is that one record will have the RECORD-ID as the key and 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._
150150
151151
The flow would look like this:
152152
153153
![](Images/cobolchClaims-img2.png)
154154
155-
- 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:
156-
157-
- accepts requests to get information of a specific record ID.
158-
- _(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.
155+
2. 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 perform the following tasks:
156+
- accept requests to get information about a specific record ID.
157+
- _(Optional)_ accept requests to get information about all the records inside the database. What does this mean? It means that instead of providing a record ID, I could provide an indicator that I want to create a report of all the records inside the database.
159158
160159
![](Images/cobolchClaims-img3.png)
161160
162161
_The purpose of the COBOL sub-routine is to allow other COBOL programs or other application to access the information inside the VSAM file._
163162
164-
- 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:
165-
166-
- 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.
167-
- It should receive the response from the sub-routine.
168-
- 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.
163+
3. 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:
164+
- The program calls the COBOL sub-routine passing the Record ID or, optionally, an indicator that you want to print all records in the database.
165+
- It receives the response from the sub-routine.
166+
- It processes the response and generates a report. This report can be a formal report or just a display in the SYSOUT. It’s up to you.
169167
170168
The flow should look like this:
171169
172170
![](Images/cobolchClaims-img4.png)
173171
174-
- Create your JCLs.
172+
4. Create your JCLs.
175173
176174
_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._
177175
178-
- _(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+
5. _(Optional)_ Create an application. It can be any type of application; 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.
179177
180-
This is an example of a possible design of the application:
178+
This is an example of a possible application design:
181179
182180
![](Images/cobolchClaims-img5.png)
183181
184182
185-
**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+
**Hint:** How can I accomplish this? By using the Zowe CLI NPM package, you can fire Zowe APIs that 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.
186184
187185
**Hint:** 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).
188186
189-
- _(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.
187+
6. _(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.
190188
191189
Sample CI/CD Build using CircleCI:
192190
193191
![](Images/cobolchClaims-img6.gif)
194192
195-
### Craving for more programming challenge?
193+
### Craving more programming challenges?
196194
197195
Add more functionality to your COBOL Sub-routine like:
198196

0 commit comments

Comments
 (0)