You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: COBOL Programming Course #2 - Advanced Topics/COBOL Programming Course #2 - Advanced Topics.md
+31-33Lines changed: 31 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,29 +49,29 @@ Can you fix the code to get the correct result? The new source code is named **C
49
49
50
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
51
52
-
# COBOL Challenge - The COVID-19 Reports
52
+
##COBOL Challenge - The COVID-19 Reports
53
53
54
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
55
56
-
## Instructions
56
+
###Instructions
57
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:
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:
59
59
60
60

61
61
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.
63
63
64
64

65
65
66
-
- Using Zowe, upload the CSV file to the mainframe.
66
+
3. Using Zowe, upload the CSV file to the mainframe.
67
67
68
68
**Hint:** You can use the command `zowe files ul ftds “file location” “dataset name”` to upload the CSV file to the mainframe.
69
69
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.
71
71
72
72
**Hint:** You can create a member using Zowe Explorer or Zowe CLI.
73
73
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:
If you want a more challenging approach, try the optional tasks below:
97
97
@@ -103,17 +103,17 @@ If you want a more challenging approach, try the optional tasks below:
103
103
104
104

105
105
106
-
## Solution
106
+
### Solution
107
107
108
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
109
110
110
Happy Coding! 😉
111
111
112
112
_Disclaimer: This challenge is also posted in [Medium.com](https://medium.com/@jessielaine.punongbayan/cobol-challenge-covid-19-reports-ee03a946bd23)._
113
113
114
-
# COBOL Challenge - The Unemployment Claims
114
+
## COBOL Challenge - The Unemployment Claims
115
115
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:
117
117
118
118

119
119
@@ -123,7 +123,7 @@ _Of course, you do not have to complete the whole challenge if you do not want t
123
123
124
124
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.
125
125
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.
127
127
I chose this because it is separated according to different categories:
@@ -138,61 +138,59 @@ You can consume the data in different formats such as CSV, RDF, JSON or XML. You
138
138
139
139
You are given a new set of data for The Unemployment Claims. Your tasks are as follows:
140
140
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.
144
144
145
145
### Instructions
146
146
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.
148
148
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._
150
150
151
151
The flow would look like this:
152
152
153
153

154
154
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.
159
158
160
159

161
160
162
161
_The purpose of the COBOL sub-routine is to allow other COBOL programs or other application to access the information inside the VSAM file._
163
162
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.
169
167
170
168
The flow should look like this:
171
169
172
170

173
171
174
-
- Create your JCLs.
172
+
4. Create your JCLs.
175
173
176
174
_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._
177
175
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.
179
177
180
-
This is an example of a possible design of the application:
178
+
This is an example of a possible application design:
181
179
182
180

183
181
184
182
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.
186
184
187
185
**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).
188
186
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.
190
188
191
189
Sample CI/CD Build using CircleCI:
192
190
193
191

194
192
195
-
### Craving for more programming challenge?
193
+
### Craving more programming challenges?
196
194
197
195
Add more functionality to your COBOL Sub-routine like:
0 commit comments