Mainframe Path Start learning free
Core7 min readLesson 1 of 6

VS Code for daily mainframe work

Many mainframe teams now edit COBOL, JCL and copybooks in Visual Studio Code next to the ISPF screens they already know. The editor, search across files, the integrated terminal and workspaces cover most daily work, and extensions such as IBM Z Open Editor and Zowe Explorer add mainframe languages and access to data sets, z/OS UNIX files and jobs.

Why a mainframe team uses VS Code

ISPF is still the fastest way to look at a data set on the system itself. But once source lives in Git, most changes start in a desktop editor: you search a whole repository in a second, see every changed line before you commit, and keep the JCL, the COBOL and the copybooks of one change side by side. Visual Studio Code (VS Code) is the editor many teams settle on because it is free, runs on Windows, macOS and Linux, and has Git built in.

The parts you use every day

What you wantIn VS CodeThe ISPF habit it replaces
Find any commandCommand Palette: Ctrl+Shift+P (macOS ⇧⌘P)Remembering option numbers
Open a file by nameQuick Open: Ctrl+P=3.4 and a data set name pattern
Search every fileSearch: Ctrl+Shift+F, with regular expressions and include/exclude patterns such as **/*.cpySRCHFOR across a library
Run commandsIntegrated terminal: Ctrl+` (or Terminal > New Terminal)TSO READY or OMVS
See and stage changesSource Control view: Ctrl+Shift+GComparing two members by eye

The terminal opens at the root of your workspace, so git status there talks about the repository you are looking at. You can open several terminals side by side, each with its own shell.

Workspaces

Opening a folder makes it your workspace. A multi-root workspace holds several folders in one window, for example the payroll-batch repository and the shared copybook repository, added with File > Add Folder to Workspace. Saving it creates a .code-workspace file, which also stores settings that apply to every folder in it.

payroll.code-workspace (fictional)Illustrative example
{
  "folders": [ { "path": "payroll-batch" }, { "path": "shared-copybooks" } ],
  "settings": { "files.trimTrailingWhitespace": false }
}

Extensions for z/OS work

TRY IT YOURSELF

Which key combination opens the Command Palette in VS Code on Windows or Linux?

Show a hint

Ctrl, Shift and the first letter of Palette.

Show the solution

Ctrl+Shift+P (⇧⌘P on macOS).

Examples are for learning. Run commands and jobs only on a system you are authorised to use, such as a training or test system, and never on production without approval.

Common mistakes

Editing the z/OS member and the Git file at the same time

They are separate copies. Change the repository, commit, and let the build put it on z/OS.

Searching one file at a time

Ctrl+Shift+F searches the whole workspace; an include pattern such as **/*.cpy narrows it to copybooks.

Installing any extension you find

Use the extensions your site has approved; an extension can read every file you open.

What you will see at work

Key terms

Check your understanding.
Take this lesson's quiz and save your progress. Free.

Take the lesson quiz
Git hands-on: status, staging, commits and history →