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
@@ -291,6 +291,8 @@ The typical automated check follows these steps:
291
291
You can take a look at the COBOL Check wiki page for better understanding: https://github.com/openmainframeproject/cobol-check/wiki/A-Brief-Example
292
292
293
293
294
+
//
295
+
294
296
## Lab
295
297
296
298
In this lab exercise, you will learn to set up and automate the COBOL Check environment using GitHub Actions. You'll create a GitHub repository that connects to an IBM Z system, accesses USS (Unix System Services), and automates the process of running COBOL Check on sample programs.
@@ -328,8 +330,6 @@ Note: While many steps are automated, you'll still interact directly with the ma
328
330
329
331
By the end of this lab, you'll have practical experience in setting up an automated testing environment for COBOL programs, bridging the gap between mainframe development and modern DevOps practices.
330
332
331
-
//
332
-
333
333
### Set up a GitHub repository with necessary workflows and scripts
334
334
1.**Create a new GitHub repository**
335
335
- Log into your GitHub account
@@ -438,227 +438,128 @@ By the end of this lab, you'll have practical experience in setting up an automa
- Ensure both scripts have Unix-style line endings (LF, not CRLF)
487
502
488
503
7. **Add COBOL Check files**
489
-
- Download the latest COBOL Check distribution from the official repository
490
-
- Extract the contents into your `cobol-check` directory
491
-
492
-
8. **Commit and push your changes**
493
-
- Stage your new files: `git add .`
494
-
- Commit the changes: `git commit -m \"Initial setup for COBOL Check automation\"`
495
-
- Push to GitHub: `git push origin main`
496
-
497
-
9. **Verify workflow**
498
-
- Go to the \"Actions\" tab in your GitHub repository
499
-
- You should see the workflow running (triggered by your push)
500
-
- Wait for it to complete and check the logs for any errors
501
-
502
-
503
-
By following these steps, you'll have set up a GitHub repository with the necessary workflow and scripts to automate COBOL Check operations. This setup forms the foundation for the rest of the lab exercises, where you'll use this automation to interact with the mainframe and run COBOL Check on your programs."
504
-
505
-
//
506
-
507
-
1. Get the latest COBOL Check distribution from the GitHub repository of the COBOL Check https://github.com/openmainframeproject/cobol-check/tree/Developer/build/distributions.
508
-
Click on the “View raw” button or the download button on the right most corner. You will get the .zip of COBOL Check.
509
-
510
-

511
-
512
-
*Figure 1. Download COBOL Check distribution*
513
-
514
-

515
-
516
-
*Figure 2. Button to download the .zip file*
517
-
518
-
2. Check your download location to view the .zip file and then extract it.
519
-
520
-

521
-
522
-
*Figure 3. COBOL Check folder*
523
-
524
-
3. Open your VS Code with the same team configuration file with the Learn Cobol folder which you have used in course 2. If not, you can also download it from https://github.com/openmainframeproject/cobol-programming-course/releases/latest
525
-
526
-
4. click on the icon of Zowe Explore of VS Code.
527
-
528
-

529
-
530
-
*Figure 4. Zowe Explorer*
531
-
532
-
In the DATA SETS section, you can view all the PDS (Partitioned datasets) and sequential files present. In the USS (Unix System Services) section, you can view the files or folder that is stored in the USS. USS is a posix compliant linux like environment which makes it easy for developers to interact with previous knowledge of using linux terminals and commands. In the JOBS section, you can view all about the running or completed jobs.
533
-
534
-
535
-
5. Put your username and password in all the three sections by clicking on the search icon to view the files (DATA SETS, USS, JOBS) which you have learned in the previous chapters.
536
-
537
-

504
+
* Get the latest COBOL Check distribution from the GitHub repository of the COBOL Check https://github.com/openmainframeproject/cobol-check/tree/Developer/build/distributions. Click on the “View raw” button or the download button on the right most corner. You will get the .zip of COBOL Check.
538
505
539
-
*Figure 5. Enter your username*
506
+

540
507
541
-

508
+
*Figure 1. Download COBOL Check distribution*
542
509
543
-
*Figure 6. Enter your password*
510
+

544
511
545
-
6. After entering your username and password for the USS section search for `/z/z999XX` . put your username in place of z999XX. Now you can view all the files that are present in the USS.
512
+
*Figure 2. Button to download the .zip file*
546
513
547
-

514
+
* Check your download location to view the .zip file and then extract it to the root of your local repository.
548
515
549
-
*Figure 7. Search for /z/z999XX*
516
+

550
517
551
-
7. Another way of interacting with the USS is through the SSH connection. Open your terminal in the vs code window. Issue the command `ssh [email protected]` , in the place of z99998 use your own username. You can find the ip address in the zowe.config file that comes with the team configuration folder.
552
-
553
-

554
-
555
-
*Figure 8. ssh connection*
556
-
557
-
8. Enter your password to view the directories in the USS. Issue your first command `pwd` which will show the directory you are currently in, that is your root directory. Issue the command `ls` to list all the files and folders in this directory.
558
-
559
-

560
-
561
-
*Figure 9. present working directory*
562
-
563
-
9. You need to create a directory for COBOL Check and copy the contents of the COBOL Check distribution that you have downloaded earlier. Issue the command `mkdir cobolcheck` - This will create an empty directory. Then use `ls` command to view the created directory.
564
-
565
-

566
-
567
-
*Figure 10. Create COBOL Check directory in the USS*
568
-
569
-
10. Issue `cd cobolcheck` to enter into the directory.
570
-
571
-

572
-
573
-
*Figure 11. Enter into COBOL Check directory in the USS*
574
-
575
-
Note: If you left your terminal idle for some time, you need to kill that terminal, again you have to ssh into the mainframe. you can follow from step 8 again.
576
-
577
-
11. Open another terminal tab and go to the file location where the files and folders of COBOL Check are present. Then use `ls` to see those.
578
-
579
-

580
-
581
-
*Figure 12. COBOL Check directory on the local system*
582
-
583
-
12. To copy all the files and folders from this directory, you need to use the command : `zowe zos-files upload dir-to-uss "." "/z/z99998/cobolcheck" --recursive --binary-files "cobol-check-0.2.8.jar"` . Then enter your username and password. (Remember to type all the alphabets in small letters).
584
-
585
-
586
-
`Note: Use the latest version (or the version you are using) of the COBOL Check on the above command.`
518
+
*Figure 3. COBOL Check folder*
587
519
520
+
* Open your VS Code with the same team configuration file with the Learn Cobol folder which you have used in course 2. If not, you can also download it from https://github.com/openmainframeproject/cobol-programming-course/releases/latest
588
521
589
-
In this command the `.` represents the current directory
590
-
and the flag `--recursive` is used for copying all the folders which are even inside other folders.
591
-
By default, this command will copy all the files in ascii mode,
592
-
but you need to copy `the cobol-check-0.2.8.jar` in binary mode that's why the flag `--binary-files` is used.
593
-
You can look into your `/bin` folder of COBOL Check to see the latest version and name which need to use there.
594
-
At the time of writing this course material, it is version 0.2.8.
595
-
596
-
To know more about copying the files from local machine to USS, you can refer to zowe cli docs: https://docs.zowe.org/v2.4.x/web_help/index.html?p=zowe_zos-files_upload_dir-to-uss.
597
-
598
-

599
-
600
-
*Figure 13. Command to copy the files from local machine to USS*
601
-
602
-
After entering the command, you will get a message uploaded successfully.
603
-
604
-

522
+
* click on the icon of Zowe Explore of VS Code.
605
523
606
-
*Figure 14. Successfully uploaded message*
524
+

607
525
608
-
13. Now again open your terminal and ssh into the mainframe to view the files and folders in the COBOL Check directory. You can see the contents of uploaded.
526
+
*Figure 4. Zowe Explorer*
609
527
610
-

528
+
In the DATA SETS section, you can view all the PDS (Partitioned datasets) and sequential files present. In the USS (Unix System Services) section, you can view the files or folder that is stored in the USS. USS is a posix compliant linux like environment which makes it easy for developers to interact with previous knowledge of using linux terminals and commands. In the JOBS section, you can view all about the running or completed jobs.
611
529
612
-
*Figure 15. View the contents in the directory*
613
530
614
-
14. you can use the USS tab of your vs code to view the COBOL Check directory.
531
+
* Put your username and password in all the three sections by clicking on the search icon to view the files (DATA SETS, USS, JOBS) which you have learned in the previous chapters.
615
532
616
-

533
+

617
534
618
-
*Figure 16. Locate the directories on the USS section in the zowe*
535
+
*Figure 5. Enter your username*
619
536
620
-
15. Issue `ls -al` command to see the file permission of COBOL Check then issue `chmod +x cobolcheck`. This will give COBOL Check file the executable permission.
537
+

621
538
622
-

623
-
624
-
*Figure 17. Providing executable permission*
625
-
626
-
16. Do the same as done above in the `/scripts` folder. Issue command : `cd scripts` to enter into scripts directory then use `chmod +x linux_gnucobol_run_tests` to make this file executable.
627
-
628
-

629
-
630
-
*Figure 18. Providing executable permission*
631
-
632
-
Then issue command `cd ..` to come back to the parent directory.
633
-
634
-
17. View the COBOL source code and the test case files. You can also use the USS tab.
635
-
636
-

637
-
638
-
*Figure 19. view files in the USS tab*
639
-
640
-
18. You can see it comes with some source code and test files. You need to run COBOL Check using the NUMBERS.CBL to check whether COBOL Check is working correctly.
641
-
Issue the command `./cobolcheck -p NUMBERS`.
642
-
643
-
`Note: You may see the NullPointerException, but that can be ignored.`
644
-
645
-

539
+
*Figure 6. Enter your password*
540
+
541
+
* After entering your username and password for the USS section search for `/z/z999XX` . put your username in place of z999XX. Now you can view all the files that are present in the USS.
646
542
647
-
*Figure 20. Run a COBOL program with the cobolcheck command*
543
+

648
544
649
-
19. After running the command, the COBOL Check will generate a new source code named `CC##99.CBL` which includes the COBOL source code along with the test cases embedded.
545
+
*Figure 7. Search for /z/z999XX*
650
546
651
-

547
+
8. **Commit and push your changes**
548
+
- Stage your new files: `git add .`
549
+
- Commit the changes: `git commit -m \"Initial setup for COBOL Check automation\"`
550
+
- Push to GitHub: `git push origin main`
652
551
653
-
*Figure 21. Output: A new COBOL program with the test cases embedded as statements*
552
+
9. **Verify workflow**
553
+
- Go to the \"Actions\" tab in your GitHub repository
554
+
- You should see the workflow running (triggered by your push)
555
+
- Wait for it to complete and check the logs for any errors
654
556
655
-
20. You need to copy this file to the MVS data sets (Z99998.CBL) which you can view in your DATA SETS tab. Use the command `cp CC##99.CBL "//'Z99998.CBL(NUMBERS)'"`
656
557
657
-

558
+
By following these steps, you'll have set up a GitHub repository with the necessary workflow and scripts to automate COBOL Check operations. This setup forms the foundation for the rest of the lab exercises, where you'll use this automation to interact with the mainframe and run COBOL Check on your programs."
658
559
659
-
*Figure 22. Copy the newly generate COBOL program to the mainframe*
560
+
//
660
561
661
-
21. view the files in the DATA SETS tab, you can see NUMBERS in Z99998.CBL.
562
+
1. view the files in the DATA SETS tab, you can see NUMBERS in Z99998.CBL.
0 commit comments