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 with VSCode.md
+16-21Lines changed: 16 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,13 +353,13 @@ To get started, you can simply open a terminal and issue zowe. This will yield t
353
353
354
354

355
355
356
-
*Figure 1. Zowe CLI Help
356
+
*Figure 1. Zowe CLI Help*
357
357
358
358
In the example above, multiple extensions are installed. The structure of commands is `zowe <group> <action> <object>` followed by various parameters and options specific to the command. For example, a valid command is `zowe files list data-set "HLQ.*"`. This command will list data-sets matching a pattern of "HLQ.*". You can append `-h` to any command to find out more information. Frequently referring to the help can be difficult and time consuming so if your environment has access to a web browser, simply append `--help-web` or `--hw` to any command to launch interactive web help.
359
359
360
360

361
361
362
-
*Figure 2. Zowe CLI Web Help
362
+
*Figure 2. Zowe CLI Web Help*
363
363
364
364
Don’t have the CLI installed yet? You can also check out a copy of the web help for the core Zowe CLI and Zowe plug-ins [here](https://docs.zowe.org/stable/web_help/index.html).
365
365
@@ -370,29 +370,29 @@ When creating profiles you can also specify the `prompt*` keyword to be prompted
Zowe CLI provides a significant suite of z/OS data set interaction functionality. See the following figures for details on available actions and a sample list command.
*Figure 5. Sample Zowe CLI zos-files list ds command
384
+
*Figure 5. Sample Zowe CLI zos-files list ds command*
385
385
386
386
### Interacting with z/OS Jobs
387
387
Zowe CLI provides a significant suite of z/OS jobs interaction functionality. See the following figures for details on available actions and a sample job submission command.
Running commands interactively is a great way to learn the capabilities of the Zowe CLI. However, creating custom automation for your commonly repeated tasks and making use of valuable development tooling is where significant value lies. For COBOL development, significant time can be spent reviewing compiler output and testing programs. These repetitive tasks are excellent candidates for automation.
@@ -402,31 +402,31 @@ Let’s investigate automating submitting a job and verifying the return code is
402
402
403
403

404
404
405
-
*Figure 8. Sample package.json
405
+
*Figure 8. Sample package.json*
406
406
407
407
Then I will create a config.json file to store all the variables I may wish to change for my project. In this case, we will set the job to submit and the maximum allowable return code for that job.
408
408
409
409

410
410
411
-
*Figure 9. Sample config.json
411
+
*Figure 9. Sample config.json*
412
412
413
413
Next we will write our automation. The Zowe CLI was built with scripting in mind and can output responses in JSON format which can be easily parsed.
414
414
415
415

416
416
417
-
*Figure 10. Sample Zowe CLI response format JSON output
417
+
*Figure 10. Sample Zowe CLI response format JSON output*
418
418
419
419
Now, instead of issuing this command and reviewing it to see if the retcode is less than or equal to 4, we want to automate it. See the implementation in a node script below.
420
420
421
421

422
422
423
-
*Figure 11. Sample code to submit job and verify output is less than or equal to a maximum allowable RC
423
+
*Figure 11. Sample code to submit job and verify output is less than or equal to a maximum allowable RC*
424
424
425
425
I had to make the investment to write this automation but for future job submissions I can simply issue `npm run submitJob`. IDEs like VS Code can visualize these tasks making my commonly repeated tasks as easy as clicking a button :). This job could compile, link, and/or run a COBOL program.
426
426
427
427

428
428
429
-
*Figure 12. Vizualization of npm script and sample run
429
+
*Figure 12. Vizualization of npm script and sample run*
430
430
431
431
More advanced code automating the compilation, deployment to test environment, and testing of a COBOL CICS application is described in this [blog](https://medium.com/zowe/continuous-integration-for-a-mainframe-app-800657e84e96).
432
432
@@ -435,13 +435,13 @@ Another good example of automating tasks using Zowe CLI is when you want to inte
435
435
436
436

437
437
438
-
*Figure 13. "One Click" COBOL build process
438
+
*Figure 13. "One Click" COBOL build process*
439
439
440
440
You can then level-up this process by leveraging a CI/CD pipeline. What is a CI/CD pipeline? It is an automated way of building, testing, and deploying your application and you can do the same with your COBOL development. The figure below shows the pipeline for the same automated tasks that we did earlier.
441
441
442
442

443
443
444
-
*Figure 14. CI/CD pipeline of the "one click" COBOL build process
444
+
*Figure 14. CI/CD pipeline of the "one click" COBOL build process*
445
445
446
446
To know more about this topic, check [this](https://medium.com/@jessielaine.punongbayan/how-i-used-typescript-to-generate-my-cobol-programs-a2a180209148) out.
447
447
@@ -936,8 +936,7 @@ The DATA DIVISION is where characteristics of data are defined in one of the fol
936
936
937
937
- LINKAGE SECTION:
938
938
939
-
Describe data from another program.
940
-
When defining data developed for internal processing.
939
+
Describes data from another program. When defining data developed for internal processing.
941
940
942
941
- WORKING-STORAGE SECTION:
943
942
@@ -947,10 +946,6 @@ When defining data developed for internal processing.
947
946
948
947
Storage allocated each time a program is called and de-allocated when the program ends.
949
948
950
-
- LINKAGE SECTION:
951
-
952
-
Describes data from another program.
953
-
954
949
#### PROCEDURE DIVISION
955
950
956
951
The PROCEDURE DIVISION contains instructions related to the manipulation of data and interfaces with other procedures are specified.
@@ -1407,7 +1402,7 @@ A list of COBOL variable name restrictions or rules are:
1407
1402
1408
1403
- Must not contain a space as a part of the name.
1409
1404
1410
-
- Name contains letters (A-Z), digits (0-9), minus sign and hyphens (-).
1405
+
- Name contains letters (A-Z), digits (0-9), underscores (_) and hyphens (-).
0 commit comments