If you are a Mainframe developer, you have probably spent a lot of time working with ISPF, TSO, datasets, JCL, and SDSF.
These tools are powerful and widely used in enterprise Mainframe environments. However, what if you could perform many of these activities directly from Visual Studio Code?
Imagine being able to:
- Browse Mainframe datasets from VS Code
- Open and edit dataset members
- Access the USS filesystem
- Write Python scripts directly inside USS
- Submit JCL without switching to another tool
- Check job status and view spool logs
- Work with Mainframe files using a modern editor
Sounds interesting, right?
In this article, we will learn how to set up Visual Studio Code (VS Code) with the Zowe Explorer extension and use it to interact with an IBM Mainframe running z/OS.
1. What Is Zowe Explorer?
Zowe Explorer is a VS Code extension that allows developers to interact with Mainframe resources through a graphical interface.
Instead of performing every operation through a traditional 3270 terminal, you can access many Mainframe resources directly from VS Code.
Using Zowe Explorer, you can:
- Browse MVS datasets and members
- Create and edit datasets
- Access UNIX System Services (USS) files
- Upload and download files
- Submit JCL jobs
- Monitor job status
- View job output and spool files
It provides a modern interface for working with Mainframe resources while still using the underlying z/OS environment.
Official documentation: https://docs.zowe.org/stable/user-guide/ze-usage/
2. Why Should Mainframe Developers Use VS Code?
Let’s understand why VS Code can be useful for Mainframe developers.
1. Modern development experience
VS Code provides a familiar editor with features such as:
- Multiple editor tabs
- Search and replace
- Keyboard shortcuts
- File navigation
- Integrated terminal
- Git integration
2. Direct access to Mainframe resources
You don’t necessarily need to download a dataset manually, edit it locally, and upload it again.
Zowe Explorer allows you to open supported Mainframe resources, edit them, and save the changes back to the host.
3. Easier Python development
Python scripts stored in USS can be opened and edited directly in VS Code.
This makes it convenient for developers who want to use Python alongside traditional Mainframe technologies.
4. JCL submission and job monitoring
You can submit JCL from VS Code and view the corresponding job output using the Jobs view.
5. Work with multiple resources together
You can keep your Python script, JCL, documentation, and other local files open in the same VS Code workspace.
This is especially useful when developing automation scripts or Mainframe batch applications.
3. Prerequisites Before Setting Up VS Code
Before starting, make sure you have the following:
| Requirement | Description |
|---|---|
| VS Code | Installed on your local machine |
| Zowe Explorer | VS Code extension |
| Mainframe credentials | User ID and authentication details |
| z/OS access | Permission to access datasets, USS, and jobs |
| z/OSMF or RSE API | A supported Mainframe connection service configured by your organization |
Important: Installing Zowe Explorer alone does not automatically provide Mainframe connectivity.
Your Mainframe environment must expose the required services, and your user ID must have the appropriate permissions.
For example, your organization may provide:
- z/OSMF URL
- Mainframe user ID
- Password or approved authentication method
- Required port or connection details
- Instructions for connecting through corporate VPN
If you are working in an enterprise environment, contact your Mainframe administrator for these details.
4. Install Zowe Explorer in VS Code
Let’s install the extension.
Step 1: Open VS Code
Launch Visual Studio Code on your laptop.
Step 2: Open Extensions
Click the Extensions icon from the left Activity Bar.
You can also use the keyboard shortcut:
Ctrl + Shift + X
Step 3: Search for Zowe Explorer
Search for:
Zowe Explorer
Install the extension published by the Zowe project.
After installation, the Zowe icon will appear in the VS Code Activity Bar.
You can now open Zowe Explorer.
Official installation guide:
https://docs.zowe.org/stable/getting-started/user-roadmap-zowe-explorer/
5. How to Connect VS Code to Mainframe Using Zowe Explorer?
This is one of the most important steps.
Zowe Explorer uses connection profiles to connect to Mainframe services.
A profile contains information such as:
- Mainframe service URL
- User ID
- Authentication details
- Connection configuration
Let’s create one.
Step 1: Configure the Zowe Extension
For a typical z/OSMF connection, you will need details similar to:
Profile Name : MYMAINFRAME
Host : https://mainframe.company.com
Port : 443
User ID : ANKIT01
These values are illustrative only.
Use the actual hostname, port, and authentication details provided by your organization.
The profile configuration is generally stored in a Zowe configuration file as well as Zowe schema file, such as:
zowe.config.json & zowe.schema.json
Also now you can placed both these files into the .zowe directory under your user directory.
Step 2: Open Zowe Explorer
Click the Zowe icon from the left Activity Bar.
You should see sections such as:
- DATA SETS
- UNIX SYSTEM SERVICES
- JOBS
These sections allow you to explore different Mainframe resources.
Step 3: Authenticate
Depending on your organization’s authentication setup, you may need to:
- Enter your Mainframe user ID and password
- Log in through an authentication service
- Complete an approved SSO or MFA flow
Zowe Explorer supports different authentication mechanisms depending on the connection type and server configuration.
Step 4: Verify the Connection
After creating the profile, refresh the relevant Zowe Explorer view.
If the connection is successful, you should be able to browse Mainframe resources.
Congratulations! Your VS Code is now connected to Mainframe.
6. Understanding the Zowe Explorer Interface
Once connected, let’s understand the interface.
The Zowe Explorer interface mainly contains three important views.
DATA SETS
This view allows you to access MVS datasets.
For example:
ANKIT01
|
+-- ANKIT01.TEST.JCL
|
+-- ANKIT01.TEST.PYTHON
|
+-- ANKIT01.TEST.DATA
You can search, browse, open, and edit datasets and members based on your permissions.
UNIX SYSTEM SERVICES
This view allows you to access the USS filesystem.
For example:
/home/ankit/
|
+-- python/
| |
| +-- hello.py
| +-- process_data.py
|
+-- jcl/
|
+-- python_job.jcl
You can navigate directories and open USS files directly in VS Code.
JOBS
This view allows you to monitor Mainframe jobs.
For example:
JOBS
|
+-- JOB12345
| |
| +-- JESMSGLG
| +-- JESJCL
| +-- JESYSMSG
| +-- SYSOUT
|
+-- JOB12346
You can check job status and open spool files to view execution details.
7. How to Access Mainframe Datasets from VS Code?
Now let’s understand how to access datasets.
Step 1: Open DATA SETS
In Zowe Explorer, locate the DATA SETS section.
Step 2: Add a Dataset Search Pattern
Click the search/filter option and enter your dataset name or pattern.
For example:
ANKIT01.TEST.*
Or:
ANKIT01.*
The search pattern helps you find datasets associated with your user ID or another permitted high-level qualifier.
Step 3: Expand the Dataset
Once the dataset appears, expand it.
If it is a partitioned dataset, you may see members such as:
ANKIT01.TEST.JCL
|
+-- PYTHON
+-- COBOL
+-- TESTJOB
Step 4: Open a Member
Double-click a member to open it in the VS Code editor.
For example:
ANKIT01.TEST.JCL(PYTHON)
The member content will open in an editor tab.
Step 5: Edit and Save
You can now make changes to the member.
After editing, save the file.
The changes are saved back to the Mainframe dataset, subject to your permissions and the resource’s supported editing behavior.
This is particularly useful when working with JCL.
Instead of opening ISPF, editing the member, and submitting it separately, you can perform these activities from VS Code.
8. How to Access USS Files and Write Python Scripts Directly?
This is where things become interesting for Python developers.
Instead of writing Python code locally and transferring it to Mainframe, you can create and edit Python files directly in USS using Zowe Explorer.
Step 1: Open UNIX SYSTEM SERVICES
Go to the UNIX SYSTEM SERVICES section in Zowe Explorer.
Step 2: Navigate to Your USS Directory
For example:
/home/ankit/
Or:
/home/ankit/python/
The directory must exist, and you need the required access permissions.
Step 3: Create a Python File
Use the USS view’s available file creation option to create a new file.
For example:
hello.py
If the directory doesn’t exist, create it first using the available folder creation option.
Step 4: Write Python Code
Open the file and write the following:
print("Hello from IBM Mainframe!")
print("Python script created directly in USS")
print("Working with VS Code and Zowe Explorer")
Save the file.
Your Python script is now stored in the Mainframe USS filesystem.
Step 5: Verify the File
You should see something similar to:
/home/ankit/python/
|
+-- hello.py
You can reopen the file whenever required and modify the code.
Important: Zowe Explorer allows you to create and edit USS files, but it is not itself a Python runtime. To execute the script, use an available USS shell or submit a suitable batch job.
9. How to Submit JCL Directly from VS Code?
Now let’s see how to submit JCL without switching to ISPF.
Step 1: Open Your JCL Member
Navigate to:
ANKIT01.TEST.JCL
Open the required member.
For example:
PYTHON
Step 2: Write JCL
Let’s create a simple Python batch job.
//PYTHON JOB //STEP1 EXEC PGM=BPXBATCH //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=*//STDPARM DD*sh python3 /home/ankit/python/hello.py/*
This example executes a Python script stored in USS.
Here:
PGM=BPXBATCHinvokes the z/OS batch utility.STDPARMruns the specified command through the shell.python3invokes the Python interpreter available through the configured environment./home/ankit/python/hello.pyis the Python script path.STDOUTcaptures standard output.STDERRcaptures standard error.
Depending on your installation, you may need to configure the Python executable path, environment variables, or runtime libraries.
Step 3: Save the JCL
Save the JCL member in the Mainframe dataset.
Step 4: Submit the Job
Right-click the JCL member in the DATA SETS view.
Select:
Submit Job
Zowe Explorer will submit the JCL to Mainframe.
A notification should appear with information about the submitted job, including its job ID.
For example:
JOB12345
You can use this job ID to track the execution.
That’s it! You have submitted a Mainframe batch job directly from VS Code.
10. How to Check JCL Execution Logs in VS Code?
After submitting a job, the next important activity is checking whether it completed successfully.
You can do this through the JOBS view.
Step 1: Open JOBS
Navigate to the JOBS section in Zowe Explorer.
Step 2: Refresh the Job List
Refresh the view to retrieve the latest jobs.
You can search or filter jobs based on your user ID, job name, or other supported criteria.
Step 3: Find Your Job
Locate the job you submitted.
For example:
JOB12345
Expand the job.
Step 4: Open Spool Files
You may see spool files such as:
JESMSGLG
JESJCL
JESYSMSG
SYSOUT
Double-click the required spool file to open it in the VS Code editor.
Step 5: Check the Output
For our Python job, the output might look like:
Hello from IBM Mainframe!
Python script created directly in USS
Working with VS Code and Zowe Explorer
If the job fails, inspect:
- JESMSGLG – Job messages and completion information
- JESJCL – JCL used for execution
- JESYSMSG – System messages and execution details
- SYSOUT – Program output, when configured
You can also check the job return code in the job information.
For example:
CC 0000
Generally indicates successful completion, although the exact interpretation depends on the job and its steps.
If you get a non-zero return code, check the relevant spool output to understand the issue.
This is one of the most useful features of Zowe Explorer: you can submit JCL and inspect the execution logs without leaving VS Code.
11. Complete Workflow: Python Development on Mainframe Using VS Code
Let’s summarize everything with a real workflow.
Imagine you need to create a Python script and execute it as a Mainframe batch job.
Your workflow would be:
VS Code
|
v
Zowe Explorer
|
v
Connect to Mainframe
|
+---------------------+
| |
v v
USS View DATA SETS View
| |
v v
Create Python Create/Open JCL
Script |
| |
v v
Save hello.py Save JCL Member
| |
+----------+-----------+
|
v
Submit JCL
|
v
JOBS View
|
v
Check Job Status
|
v
Open Spool Logs
|
v
Verify Output
This approach allows you to develop Python scripts, manage Mainframe files, submit jobs, and monitor execution from a single development environment.
12. Important Things to Remember
Before using Zowe Explorer in your organization, keep these points in mind:
- You need a supported Mainframe connection service such as z/OSMF or RSE API.
- Your user ID must have the required dataset, USS, and job permissions.
- Access to USS is controlled by Mainframe security and filesystem permissions.
- Python must be installed and configured separately on z/OS.
- Zowe Explorer is used to access resources; it does not execute Python by itself.
- JCL submission requires appropriate job submission permissions.
- Job output may be restricted depending on your access.
- Authentication should follow your organization’s security standards.
- Avoid storing Mainframe credentials in plain-text configuration files.
- Always follow your organization’s rules for editing and submitting production JCL.
Conclusion
Visual Studio Code with Zowe Explorer provides a modern and convenient way to interact with IBM Mainframe.
With this setup, you can:
- Connect to z/OS
- Browse and edit datasets
- Access USS directories
- Write Python scripts directly in USS
- Submit JCL from VS Code
- Monitor jobs and view spool logs
For developers working with Python, JCL, DB2, and Mainframe datasets, this workflow can make everyday development activities much easier.
You don’t have to leave the Mainframe environment to enjoy a modern development experience. You can bring Mainframe development into VS Code!
Happy coding!
Official References
- Zowe Explorer – https://docs.zowe.org/stable/user-guide/ze-usage/
- Installing Zowe Explorer – https://docs.zowe.org/stable/getting-started/user-roadmap-zowe-explorer/
- Creating Zowe Explorer Profiles – https://docs.zowe.org/stable/user-guide/ze-profiles.html
- Zowe Explorer GitHub – https://github.com/zowe/zowe-explorer-vscode