0% found this document useful (0 votes)
43 views19 pages

Module 1 Labs Current Cobol

Uploaded by

sfnkhaddi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views19 pages

Module 1 Labs Current Cobol

Uploaded by

sfnkhaddi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Lab 1.

Setting up VSCode and Extensions

Lab 1. Setting up VSCode and Extensions


Overview
This lab covers all aspects of the download and installation of Visual Studio (VS) Code and the
necessary prerequisites. This lab will cover the necessary steps and information to download and
install the prerequisites needed for the subsequent labs within this course. This software is
needed for one or more of the applications we will be utilizing in our labs throughout the course.

Objectives
 Install node.js
 Install Java SDK
 Install and run Visual Studio Code
 Install Zowe Explorer plugin
 Install IBM Z Open Editor plugin
 Complete registration

1
Lab 1. Setting up VSCode and Extensions

Lab instructions

Install node.js:

1. Check for node.js installation and verify that the version number is v8 or higher.

Open your workstation's version of the command prompt (called Terminal on Mac OS X). Once
the command prompt is open, use the command in Example 1 to check if your workstation
currently has a version of node.js installed.

Example 1. Node.js version


C:\Users\User> node -v

V12.16.1

If you do not see a version number after you submit the command, you do not have node.js
installed, or if it shows a version less than v8, you should continue following these instructions.
If you do see a version number and it is v8 or higher, you can move on to section Install Java
SDK.

2. If node.js version is less than v8, or node isn't installed at all.

Updating node.js to the appropriate version number is a relatively simple process because the
installer takes care of most of the "heavy lifting". All you will need to do is visit the Node.js
download site, provided below, and follow the download and installation instructions for your
specific workstation platform. Do this same process if you do not already have node.js installed.

https://nodejs.org/en/download/

This process will install the latest versions of Node.js and the node package manager (npm) and
overwrite any older version files in your system. This removes the step of needing to manually
uninstall the previous versions beforehand.

3. Once completed, verify the installation and proper version number, as shown previously in
Example 1.

Note: The version numbers in our examples are provided purely for reference and may not
reflect the latest versions of the software.

2
Lab 1. Setting up VSCode and Extensions

Install Java SDK:

1. Check for Java installation and verify that the version number is v8 or higher.

Open your workstation's version of the command prompt, if not already open. Once the
command prompt is open, use the command in Example 2 to check if your workstation currently
has a version of Java installed. Java SDK 8 is the preferred version for these labs, however, any
versions higher than that will suffice.

Example 1. Java version


C:\Users\User> java -version

java version "1.8.0_241"

Java(TM) SE Runtime Environment (build 1.8.0_241-b07)

Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

If you do not see a version number after you submit the command, you do not have Java installed
or if it shows a version less than v8, you should continue following these instructions. The
display format of the version number for Java is slightly different than what is displayed for
node.js. With Java, the second value in the displayed version number, i.e. the "8" in Example 2,
is the version number. So, our example is showing Java SDK version 8. If you do see a version
number and it is v8 or higher, you can move on to section Install VSCode.

2. If your version of Java displayed is less than v8, you need to uninstall the current version on
your workstation and reinstall the correct version. Follow the link below to uninstall
instructions that represent your workstation operating system (OS).

Linux: https://www.java.com/en/download/help/linux_uninstall.xml
Mac: https://www.java.com/en/download/help/mac_uninstall_java.xml
Windows: https://www.java.com/en/download/help/uninstall_java.xml

3. Once Java is uninstalled from your workstation, you can click the Java JDK 8 download link
below and follow the installation instructions for your specific OS.

https://www.oracle.com/java/technologies/javase/javase-jdk8-
downloads.html

4. Verify the installation and proper version number as shown in Example 2.

Note: You will be prompted to register a new Oracle account in order to download the
installation file, please do so. If you have an existing account, you may use that to log in and
continue.

3
Lab 1. Setting up VSCode and Extensions

Install VSCode
If you do not already have VSCode installed on your workstation, please do so now by following
the download and installation instructions at the link below:

https://code.visualstudio.com/download

Figure 1. VSCode download site

Note: Be sure to select the correct installation file for your workstations respective OS, shown
in Figure 1.

Install VSCode extensions


This section introduces two VSCode extensions, Zowe Explorer and IBM Z Open Editor, listed
in Figure 2, and instructions on how to install them.

Figure 2. VSCode required extensions

4
Lab 1. Setting up VSCode and Extensions

Zowe Explorer:

Zowe is a new, and the first open source framework for z/OS and provides solutions for
development and operations teams to securely manage, control, script and develop on the
mainframe like any other cloud platform. Out of the box, the Zowe Explorer provides a lot of
functionality allowing z/OS developers access to jobs, datasets and (USS) files on a z/OS server.
Backed by the Zowe CLI and z/OSMF, developers now have powerful features that makes it
easy to work with z/OS within the familiar VSCode environment. This extension can be used to
edit COBOL and PL/I files opened on z/OS MVS™ and USS using the Zowe extension's Data
Sets and USS views. It can even run JCL and lets you browse job spool files. For more
information on Zowe Explorer and its interaction with z/OS please visit:

https://ibm.github.io/zopeneditor-about/Docs/
interact_zos_zowe_explorer.html

Install Zowe Explorer:

Open VSCode and in the left side tool menu select Extensions. From there, in the "Search
Extensions in Marketplace" search field, type Zowe Explorer. Search results will begin
populating, select "Zowe Explorer" and click install, depicted in Figure 3.

Figure 3. Install Zowe Explorer in VSCode

The Zowe community has a number of on-line videos that walk through the steps required to
install, configure and operate the Zowe Explorer, see:
http://www.youtube.com/watch?v=G_WCsFZIWt4&t=0m38s

5
Lab 1. Setting up VSCode and Extensions

IBM Z Open Editor:

IBM Z Open Editor brings COBOL and PL/I language support to Microsoft VSCode. It is one of
the several next generation capabilities for an open development experience for z/OS®. It also
works in association with the Zowe Explorer plugin. For more information on IBM Z Open
Editor, please visit:

https://ibm.github.io/zopeneditor-about/Docs/introduction.html#key-
capabilities

Install IBM Z Open Editor:

Open VSCode and in the left side tool menu select Extensions. From there, in the "Search
Extensions in Marketplace" search field, type IBM Z Open Editor. Search results will begin
populating, select " IBM Z Open Editor " and click install, depicted in Figure 4.

Figure 4. Install IBM Z Open Editor in VSCode

Note: There may be some limitations with IBM Z Open Editor if running a 32-bit Java version
on Windows.

Register for an account:

6
Lab 1. Setting up VSCode and Extensions

Follow the link provided below to register for an account with the mainframe. This account
registration will provide you with a username, password and z/OSMF URL to establish your
connection to the mainframe and must be done before moving on to lab 2.

You will be registered into the IBM Z XPlore learning experience system; you are required to
click into the “Open Mainframe Project COBOL Programming Course” section and complete the
“Access Resources” challenge.

Registration Link:

https://ibm.biz/cobollabs

7
Lab 2. Connecting to the Mainframe

Lab 2. Connecting to the Mainframe


Overview
In this lab exercise you will connect to an IBM Z mainframe system, view a simple COBOL
hello world program in VSCode, submit JCL to compile the COBOL program, and view the
output.

Objectives
 Setup connection profile in Zowe Explorer
 Connect to z/OS through connection profile
 Filter data sets
 Submit “hello world” job
 View jobs output

8
Lab 2. Connecting to the Mainframe

Lab instructions
1. The lab assumes installation of VSCode with Z Open Editor and Zowe Explorer extensions
as shown in Figure 1.

Click Extensions icon


List should include:
1. IBM Z Open Editor
2. Zowe Explorer
Figure 1. VSCode extensions

2. Click the Zowe Explorer icon as shown in Figure 2.

Figure 2. Zowe Explorer icon

3. In order to connect to the lab system, get your team configuration zip file and extract it. You
can obtain the team configuration zip file from the .zip file you downloaded along with this
document.

9
Lab 2. Connecting to the Mainframe

Figure 3. Team Configuration Zip Folder

4. Open the extracted folder. You will find the two configuration files as shown in Figure 4.

Figure 4. Inside the Team Configuration folder

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

10
Lab 2. Connecting to the Mainframe

Figure 5. Click the Open Folder button

6. A pop-up window would show up, select the folder containing the team configuration files..

Figure 6. Select the Team Configuration folder

11
Lab 2. Connecting to the Mainframe

If you are prompted to trust the authors of the files in the folder as shown in Figure 7, select
Yes, I trust the authors.

Figure 7. Trust the Authors of Files in The Folder

7. Your connection should be added automatically to the Data Sets list as shown in Figure 8.

Figure 8. LearnCOBOL Connection

If the connection does not appear, hover to the far right of the Data Sets line and press the +
icon. Afterward, select the LearnCOBOL connection as shown in Figure 9.

12
Lab 2. Connecting to the Mainframe

Figure 9. Adding the Connection manually

8. Press the LearnCOBOL connection..

Figure 10. Password prompt

9. The connection prompts for a username as shown in Figure 11. Please enter the username
assigned to you! Do not use the sample username of Z99998.

13
Lab 2. Connecting to the Mainframe

Figure 11. Enter assigned user name

10. Enter your assigned password as shown in Figure 12.

Figure 12. Accept connections with self-signed certifications

11. Expansion of the connection (LearnCOBOL.zosmf) reads “Use the search button to display
datasets”. Click the search button as shown in Figure 13.

Figure 13. Search button

12. A prompt to "Search Data Sets" will appear as shown in Figure 14. Please enter the
username assigned to you! Do not use the sample username of Z99998.

Figure 14. Select a filter

13. A list of data set names beginning with your username will appear as shown in Figure 15.
You may have a different list as compared to what is shown in Figure 15.

14
Lab 2. Connecting to the Mainframe

Figure 15. Filtered data set names

14. Expand <USERNAME>.CBL to view COBOL source members, then select member
HELLO to see a simple COBOL ‘Hello World!’ program as shown in Figure 16.

Figure 16. USERNAME.CBL

15. Expand <USERNAME>.JCL to view JCL and select member HELLO which is the JCL to
compile and execute simple ‘Hello World!’ COBOL source code as shown in Figure 17.

15
Lab 2. Connecting to the Mainframe

Figure 17. USERNAME.JCL

16. Right click on JCL member HELLO, a section box appears. Select Submit Job for system
to process HELLO JCL as shown in Figure 18. The submitted JCL job compiles the
COBOL HELLO source code, then executes the COBOL HELLO program.

16
Lab 2. Connecting to the Mainframe

Figure 18. Submit Job

17. Observe the ‘Jobs’ section in Zowe Explorer as shown in Figure 19.

Figure 19. JOBS section

18. Again, click on the + to the far right on the Jobs selection. Result is another prompt to
‘Create new’. Select your connection (LearnCOBOL.zosmf) from the list as shown in Figure
20.

Figure 20. Select LearnCOBOL connection

19. As a result, the JCL jobs owned by your username appear. HELLOCBL is the JCL job name
previously submitted. Expand HELLOCBL output to view sections of the output as shown in
Figure 21.

17
Lab 2. Connecting to the Mainframe

Figure 21. HELLOCBL output

20. Select COBRUN:SYSPRINT(101) to view the COBOL compiler output. Scroll forward in
the COBOL compile to locate the COBOL source code compiled into an executable module
as shown in Figure 22. Observe the Indicator Area in column 7, A Area beginning in
column 8, and B Area beginning in column 12. Also, observe the period (.) scope
terminators in the COBOL source.

Figure 22. COBOL compiler output

18
Lab 2. Connecting to the Mainframe

21. View the COBOL program execution by selecting COBRUN:SYSOUT(104) from the
LearnCOBOL in the Jobs section of Zowe Explorer as shown in Figure 23.

Figure 23. COBOL program execution

22. The following URL is another excellent document describing the above VSCode and Zowe
Explorer details with examples:

https://marketplace.visualstudio.com/items?
itemName=Zowe.vscode-extension-for-zowe

19

You might also like