Interacting with z/OS®
To interact with z/OS, we recommend installing the Zowe Explorer VS Code Extension. 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.
Using the Zowe Explorer views
Once you have the Zowe VS Code extension installed, you can interact with z/OS resources by clicking on the VS Code activity bar with the Zowe icon. That will open three different views:
- The Data Sets explorer that shows your data sets and members and allows you to directly open, edit, and save your programs against MVS™.
- The Unix System Services (USS) explorer that shows you USS folders and files that you can also directly open, edit, and save.
- The Jobs explorer that gives you access to your Jobs and spool files.
See the documentation in the VS Code Marketplace for details on using and configuring each view. We also provide more examples in the following sections Manipulating data sets and Submitting JCL to compile, link, and run jobs
Using Zowe CLI in the Terminal window
The VS Code terminal window lets you run command line operations on your local development machine as well as using Zowe CLI to interact with z/OS.
Running local commands
As an example, you can use the terminal to interact with Git and perform file-based operations.
To open the Terminal window, click
Terminal > New Terminal or type
Ctrl+`. The terminal is opened at the bottom below the editor and inside the working directory that contains all the files that are shown in the Files view. You can execute Linux commands on your files.
Commonly used commands:
ls -al: Lists the directory of all your files.
git status: Shows a summary of your Git status and changed files.
Tip: You can execute any kind of Git commands on your local files right from this terminal.
Interacting with z/OS using the Zowe CLI
Zowe CLI provides various capabilities for interacting with z/OS that includes interacting with MVS, jobs, user account, and other files.
Creating a Zowe CLI profile
Before using Zowe CLI, you must create a profile and connect to z/OS. Follow these steps to create a profile:
Issue this command with your host name, z/OSMF port, user name and password:
zowe profiles create zosmf-profile zoweCLI --host host.company.com --port 443 --user USER1 --pass password --reject-unauthorized false
Note: After you create or add a Zowe profile, you need to reload the browser windows to make the profile appear in the graphical Zowe tree views provided by the Zowe VS Code extension plugin.
Test this profile with this command:
zowe zosmf check status
Running Zowe CLI commands
After you created your profile for the user
USER1 and a data set with your COBOL programs called
USER1.SAMPLE.COBOL, you can work on your MVS data sets with the following commands:
List your data sets and members:
zowe files ls ds USER1 zowe files ls all-members USER1.SAMPLE.COBOL
zowe files download ds "USER1.SAMPLE.COBOL(SAM1)"
You will see that new folders appear on the left with the names based on your data set that contains the file SAM1. You can rename it to add a
.cblextension to edit it in the COBOL editor and then later use drag-and-drop or the command line to upload it again.
Check the status of your jobs:
zowe jobs ls js | grep ACTIVE
The command above shows an example of how Zowe CLI commands can be used in combination with other Linux commands and scripts. This example returns the complete list of jobs and pipes that list into the Linux
grepcommand to filter it down to show only the active jobs. This kind of capability enables you to define all kinds of batch jobs and automation for remotely interacting with z/OS.
For an overview of available Zowe CLI commands, type
To learn about all capabilities of Zowe CLI, see Zowe CLI Online Documentation.