Using command line to interact with z/OS
You can use the Terminal window in VS Code to run command-line operations on your client. For example, you can use the terminal to perform file-based operations and execute any kind of Git commands on your local files right from this terminal.
In addition, you can interact with z/OS by using commands that are provided by IBM® RSE API plug-in for Zowe™ CLI (RSE CLI plug-in), Zowe CLI, or both in the Terminal window. These commands provide various capabilities for interacting with z/OS resources that include MVS™, jobs, and USS.
To open the Terminal window, click Terminal > New Terminal or press Ctrl+`. It 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.
Comparison between Zowe CLI and RSE CLI plug-in
Both of Zowe CLI and RSE CLI plug-in provide the commands, with slight differences in command names and options, to let you perform the following tasks:
List, create, rename, delete USS files and directories and MVS data sets and members
Run JCL jobs
Browse job spool files
Though the capabilities of Zowe CLI and RSE CLI plug-in are similar, the installation and configuration requirements are different:
To use the commands provided by Zowe CLI to interact with z/OS, you must configure z/OSMF before you install Zowe CLI.
RSE CLI plug-in extends Zowe CLI to let you interact with z/OS resources by using IBM Remote System Explorer API (RSE API) as an alternative to using z/OSMF. The RSE API is a collection of REST APIs that allow a client to work with various components on the z/OS host system, including MVS data sets, z/OS UNIX files and commands, JES jobs, and more. The overall solution results in a complete set of operations that allows you to do everything as you could do with z/OSMF. Therefore, RSE CLI plug-in is a great alternative if you have used the Remote System Explorer API with other IBM offerings such as IBM Developer for z/OS or IBM Explorer for z/OS.
For more information about the commands provided by Zowe CLI and RSE CLI plug-in, see the command mapping table.
Using RSE CLI plug-in commands
Prerequisites: Installing RSE CLI plug-in
To install RSE CLI plug-in, see the Installing IBM RSE API Plug-in for Zowe CLI section in topic Setting up integrations.
Creating an RSE profile
To avoid typing connection details on every command, you can create a user profile. You can create multiple profiles and switch between them if necessary. To create a profile via command line, issue the following command in the terminal:
zowe profiles create rse rseCLI --host host.company.com --port 6800 --user user --password password --base-path rseapi --reject-unauthorized false --protocol https --encoding IBM-1047Notes:
rseCLI: The name of the RSE profile. You can use any name that you want.--protocol: To override the default value with HTTP, specify--protocol http. The default value is https.
::: warning
When setting up your profile, you must specify the protocol to be used by the RSE RESTful API.
Make sure your administrator configured the z/OS Explorer RSE to use https for enhanced security.
For additional safety, set rejectUnauthorized: true to reject self-signed certificates, which should not be trusted in production environments.
:::
--reject-unauthorized: To reject self-signed certificates, specify true. The default value is false.--port: The port on which RSE API is running on the host. The default value is 6800. If you do not know the port number, check with your system administrator.--base-path: The base path of the API for the REST API operations. The default value is rseapi.--encoding: The default host encoding for the profile. The default value is IBM-1047.
After the RSE profile is created, you can test if the connection with the IBM Remote System Explorer API is working by typing the command to list data sets, for example, zowe rse list data-set HLQ where HLQ is a high-level qualifier or user ID that is accessible by the user ID in the profile that is created to view data sets.
Running RSE CLI plug-in commands
After installing RSE CLI plug-in, you can use it in a command-line window on your development machine. You can issue commands to perform the following tasks:
List, create, download, upload, and delete MVS data sets and members as well as USS files and directories.
Submit jobs, list jobs and spool files, download or view spool content, view job status, cancel a job, and delete a job.
For example, after you created your RSE 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 rse ls ds USER1 zowe rse ls all-members USER1.SAMPLE.COBOLDownload members:
zowe rse 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 by adding a
.cblextension to edit it in the COBOL editor, and then upload it later using drag-and-drop or via the command line.Check the status of your jobs:
zowe rse ls js | grep ACTIVEThe command above shows an example of how RSE CLI plug-in 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 the full list of available commands, see IBM RSE API Plug-in for Zowe CLI commands.
Getting help about commands and options
To learn about a command and all options for the command, add --help after the command. For instance, by specifying zowe rse list --help, you can see all the different items that can be listed and a help response like this in the terminal:
DESCRIPTION
-----------
List uss file and folders, data sets and data set members, or jobs and spool
files. Optionally, you can list their details and attributes.
USAGE
-----
zowe rse-api-for-zowe-cli list <command>
Where <command> is one of the following:
COMMANDS
--------
all-members | am List all members of a pds
data-set | ds List data sets
jobs | js List z/OS jobs on JES spool/queues
spool-files-by-jobid | sfbj List spool files of a z/OS job
uss-files | uss List USS files
GLOBAL OPTIONS
--------------
--response-format-json | --rfj (boolean)
Produce JSON formatted data from a command
--help | -h (boolean)
Display help text
--help-examples (boolean)
Display examples for all the commands in a the group
--help-web | --hw (boolean)
Display HTML help in browser
If you want to view the help response in a web browser, enter --help-web, for example, zowe rse list --help-web.

Using Zowe CLI z/OSMF commands
Prerequisites: Installing Zowe CLI
To install Zowe CLI, see the Installing Zowe CLI section in topic Setting up integrations.
Creating a Zowe CLI z/OSMF profile
Before using Zowe CLI, you must create a z/OSMF profile and connect to z/OS. Follow these steps to create a z/OSMF profile:
Issue this command with your hostname, z/OSMF port, username, and password:
zowe profiles create zosmf-profile zoweCLI --host host.company.com --port 443 --user USER1 --pass password --reject-unauthorized falseNote: After you create or add a Zowe profile, you need to reload the explorer views to make the profile appear in the graphical Zowe tree views provided by Zowe Explorer.
Test the profile with the following command:
zowe zosmf check status
Running Zowe CLI commands
For example, after you created your Zowe CLI z/OSMF 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.COBOLDownload members:
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 by adding a
.cblextension to edit it in the COBOL editor, and then upload it later using drag-and-drop or via the command line.Check the status of your jobs:
zowe jobs ls js | grep ACTIVEThe 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 zowe --help.
To learn about all capabilities of Zowe CLI, see Zowe CLI Online Documentation.