Skip to content

Commit f03cf15

Browse files
committed
Fix Zowe CLI lab instructions
Signed-off-by: Hartanto Ario Widjaya <[email protected]>
1 parent 995c5c5 commit f03cf15

File tree

5 files changed

+71
-77
lines changed

5 files changed

+71
-77
lines changed

COBOL Programming Course #2 - Learning COBOL/COBOL Programming Course #2 - Learning COBOL.md

Lines changed: 71 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ In this lab exercise, you will connect to an IBM Z system, view a simple COBOL h
422422

423423
5. Now back on your VSCode window, select the Explorer tab, and press the "Open folder" button in the left bar.
424424

425-
![](Images/image0006.png)
425+
![](Images/vscode-add-folder.png)
426426

427427
*Figure 6. Click the open folder button*
428428

@@ -565,145 +565,139 @@ In this section, we will use the Zowe CLI interactively to view data set members
565565

566566
1. Within VS Code, open the integrated terminal (Terminal -> New Terminal). In the terminal, issue `zowe --version` to confirm the Zowe CLI is installed as depicted in the following figure. If it is not installed, please refer to the section on the "Installation of Zowe CLI and Plug-ins." Also, notice that the default shell selected (outlined in red) is `bash`. I would recommend selecting the default shell as either `bash` or `cmd` for this lab.
567567

568-
![](Images/zowe/zowe-cli-version.png)
568+
![](Images/zowe/zowe-cli-version.png)
569569

570-
*Figure 29. `zowe --version` command in VS Code Integrated Terminal (Shell selection outlined in red)*
570+
*Figure 26. `zowe --version` command in VS Code Integrated Terminal*
571571

572-
2. In order for Zowe CLI to interact with z/OSMF the CLI must know the connection details such as host, port, username, password, etc. While you could enter this information on each command, Zowe provides the ability to store this information in configurations commonly known as profiles. Zowe CLI and the Zowe VS Code Extension share profiles. So if you created a connection profile in the first lab, you could naturally leverage it here.
572+
2. In order for Zowe CLI to interact with z/OSMF the CLI must know the connection details such as host, port, username, password, etc. While you could enter this information on each command, Zowe provides the ability to store this information in configurations file.
573573

574-
To create a LEARNCOBOL profile (and overwrite it if it already exists), issue the following command with your system details (using `prompt*` will prompt you for certain fields and not show input):
574+
If you have done the configuration in the first lab, you will have a folder containing your team configuration files. Make sure that your terminal is at that location and issue the following command.
575575

576-
```
577-
zowe profiles create zosmf LEARNCOBOL --host 192.86.32.250 --port 10443 --ru false --user prompt* --pass prompt* --ow
578-
```
576+
```
577+
zowe config list
578+
```
579579

580-
Many profiles can be created for interacting with different z/OSMF instances. If this was not your first profile, you will want to set it as the default for the following lab exercises. Issue the following command:
580+
The following figure demonstrates the outcome of the command.
581581

582-
```
583-
zowe profiles set zosmf LearnCOBOL
584-
```
582+
![](Images/zowe/list-team-config.png)
585583

586-
The following figure demonstrates this sequence of commands.
587-
588-
![](Images/zowe/create-and-set-zosmf-profile.png)
589-
590-
*Figure 30. Create and set z/OSMF profile (secure credential store plug-in is in use)*
584+
*Figure 27. List available team config connections*
591585

592586
3. Confirm you can connect to z/OSMF by issuing the following command:
593587

594-
```
595-
zowe zosmf check status
596-
```
588+
```
589+
zowe zosmf check status
590+
```
597591

598592
4. List data sets under your ID by issuing a command similar to (see sample output in the following figure):
599593

600-
```
601-
zowe files list ds "Z99998.*"
602-
```
594+
```
595+
zowe files list ds "Z99998.*"
596+
```
603597

604-
You can also list all members in a partitioned data set by issuing a command similar to (see sample output in the following figure):
598+
You can also list all members in a partitioned data set by issuing a command similar to (see sample output in the following figure):
605599

606-
```
607-
zowe files list am "Z99998.CBL"
608-
```
600+
```
601+
zowe files list am "Z99998.CBL"
602+
```
609603

610-
![](Images/zowe/zowe-files-list-ds-and-am-commands.png)
604+
![](Images/zowe/zowe-files-list-ds-and-am-commands.png)
611605

612-
*Figure 31. zowe files list ds and am commands*
606+
*Figure 28. zowe files list ds and am commands*
613607

614608
5. Next, we will download our COBOL and JCL data set members to our local machine. First, create and open a new folder in your file explorer. Note that you could also create a workspace to manage multiple projects. See the following figure for help:
615609

616-
![](Images/vscode-add-folder.png)
610+
![](Images/vscode-add-folder.png)
617611

618-
*Figure 32. File explorer view to demonstrate opening a new folder*
612+
*Figure 29. File explorer view to demonstrate opening a new folder*
619613

620-
Once you have an empty folder opened, return to the integrated terminal, ensure you are in your folder, and issue commands similar to:
614+
Once you have an empty folder opened, return to the integrated terminal, ensure you are in your folder, and issue commands similar to:
621615

622-
```
623-
zowe files download am "Z99998.CBL" -e ".cbl"
624-
zowe files download am "Z99998.JCL" -e ".jcl"
625-
```
616+
```
617+
zowe files download am "Z99998.CBL" -e ".cbl"
618+
zowe files download am "Z99998.JCL" -e ".jcl"
619+
```
626620

627-
Then open `hello.cbl` in your file explorer. A completed example is shown in the following figure:
621+
Then open `hello.cbl` in your file explorer. A completed example is shown in the following figure:
628622

629-
![](Images/zowe/zowe-files-download-am.png)
623+
![](Images/zowe/zowe-files-download-am.png)
630624

631-
*Figure 33. Download and view data set members using the CLI*
625+
*Figure 30. Download and view data set members using the CLI*
632626

633627
6. Next, we will submit the job in member `Z99998.JCL(HELLO)`. To submit the job, wait for it to complete, and view all spool content, issue:
634628

635-
```
636-
zowe jobs submit ds "Z99998.JCL(HELLO)" --vasc
637-
```
629+
```
630+
zowe jobs submit ds "Z99998.JCL(HELLO)" --vasc
631+
```
638632

639-
We could also perform this step in piecemeal to get the output from a specific spool file. See the next figure for an example of the upcoming commands. To submit the job and wait for it to enter OUTPUT status, issue:
633+
We could also perform this step in piecemeal to get the output from a specific spool file. See the next figure for an example of the upcoming commands. To submit the job and wait for it to enter OUTPUT status, issue:
640634

641-
```
642-
zowe jobs submit ds "Z99998.JCL(HELLO)" --wfo
643-
```
635+
```
636+
zowe jobs submit ds "Z99998.JCL(HELLO)" --wfo
637+
```
644638

645-
To list spool files associated with this job id, issue:
639+
To list spool files associated with this job id, issue:
646640

647-
```
648-
zowe jobs list sfbj JOB09413
649-
```
641+
```
642+
zowe jobs list sfbj JOB09413
643+
```
650644

651-
where `JOB09413` was returned from the previous command.
645+
where `JOB09413` was returned from the previous command.
652646

653-
To view a specific spool file (COBRUN:SYSOUT), issue:
647+
To view a specific spool file (COBRUN:SYSOUT), issue:
654648

655-
```
656-
zowe jobs view sfbi JOB09413 104
657-
```
649+
```
650+
zowe jobs view sfbi JOB09413 104
651+
```
658652

659-
where `JOB09413` and `104` are obtained from the previous commands.
653+
where `JOB09413` and `104` are obtained from the previous commands.
660654

661-
![](Images/zowe/zowe-jobs-submit-ds-and-view-spool-output.png)
655+
![](Images/zowe/zowe-jobs-submit-ds-and-view-spool-output.png)
662656

663-
*Figure 34. Submit a job, wait for it to complete, then list spool files for the job, and view a specific spool file*
657+
*Figure 31. Submit a job, wait for it to complete, then list spool files for the job, and view a specific spool file*
664658

665-
If desired, you can also easily submit a job, wait for it to complete, and download the spool content using the following command (see the following figure for the completed state):
659+
If desired, you can also easily submit a job, wait for it to complete, and download the spool content using the following command (see the following figure for the completed state):
666660

667-
```
668-
zowe jobs submit ds "Z99998.JCL(HELLO)" -d .
669-
```
661+
```
662+
zowe jobs submit ds "Z99998.JCL(HELLO)" -d .
663+
```
670664

671-
![](Images/zowe/zowe-jobs-submit-ds-and-download-spool-output.png)
665+
![](Images/zowe/zowe-jobs-submit-ds-and-download-spool-output.png)
672666

673-
*Figure 35. Submit a job, wait for it to complete, download and view spool files*
667+
*Figure 32. Submit a job, wait for it to complete, download and view spool files*
674668

675-
The Zowe CLI was built with scripting in mind. For example, you can use the `--rfj` flag to receive output in JSON format for easy parsing. See the next figure for an example.
669+
The Zowe CLI was built with scripting in mind. For example, you can use the `--rfj` flag to receive output in JSON format for easy parsing. See the next figure for an example.
676670

677-
![](Images/zowe/zowe-jobs-submit-ds-rfj.png)
671+
![](Images/zowe/zowe-jobs-submit-ds-rfj.png)
678672

679-
*Figure 36. The `--rfj` flag allows for easy programmatic usage*
673+
*Figure 33. The `--rfj` flag allows for easy programmatic usage*
680674

681675
### Zowe CLI - Programmatic Usage
682676
In this section, we will leverage the Zowe CLI programmatically to automate submitting the JCL to compile, link, and run the COBOL program and downloading the spool output. Once you have the content locally you could use any number of distributed scripting and testing tools to eliminate the need to manually review the spool content itself. Historically, in Mainframe, we use REXX Exec, CLIST, etc. for automation, but today we are going to use CLI and distributed tooling.
683677

684678
1. Since we already have Node and npm installed, let’s just create a node project for our automation. To initialize a project, issue `npm init` in your project’s folder and follow the prompts. You can accept the defaults by just pressing enter. Only the description and author fields should be changed. See the following figure.
685679

686-
![](Images/npm/npm-init-example.png)
680+
![](Images/npm/npm-init-example.png)
687681

688-
*Figure 37. Use of `npm init` to create `package.json` for the project*
682+
*Figure 34. Use of `npm init` to create `package.json` for the project*
689683

690684
2. Now that we have our `package.json` simply replace the `test` script with a `clg` script that runs the following zowe command (replace `Z99998` with your high-level qualifier):
691685

692-
```
693-
zowe jobs submit ds 'Z99998.JCL(HELLO)' -d .
694-
```
686+
```
687+
zowe jobs submit ds 'Z99998.JCL(HELLO)' -d .
688+
```
695689

696-
You can name the script whatever you want. I only suggested `clg` because the `CLG` in the `IGYWCLG` proc (which is what the JCL leverages) stands for compile, link, go. Now, simply issue `npm run clg` in your terminal to leverage the automation to compile, link, and run the COBOL program and download the output for review. An example of the completed `package.json` and command execution are shown in the following figure.
690+
You can name the script whatever you want. I only suggested `clg` because the `CLG` in the `IGYWCLG` proc (which is what the JCL leverages) stands for compile, link, go. Now, simply issue `npm run clg` in your terminal to leverage the automation to compile, link, and run the COBOL program and download the output for review. An example of the completed `package.json` and command execution are shown in the following figure.
697691

698-
![](Images/npm/npm-run-clg.png)
692+
![](Images/npm/npm-run-clg.png)
699693

700-
*Figure 38. Final `package.json` and `npm run clg` execution*
694+
*Figure 35. Final `package.json` and `npm run clg` execution*
701695

702696
3. If you prefer a graphical trigger, you can leverage VS Code as shown in the following figure. Essentially, the CLI enables you to quickly build your own buttons for your custom z/OS tasks. You could also invoke a script rather than a single command to accommodate more complex scenarios.
703697

704-
![](Images/npm/npm-run-clg-button.png)
698+
![](Images/npm/npm-run-clg-button.png)
705699

706-
*Figure 39. `clg` task triggered via button*
700+
*Figure 36. `clg` task triggered via button*
707701

708702
\newpage
709703

-1.63 MB
Binary file not shown.
Binary file not shown.
40.7 KB
Loading
-6.49 KB
Loading

0 commit comments

Comments
 (0)