Mainframe Path Start learning free
Core11 min readLesson 2 of 3

Datasets, jobs and USS files from your PC

Zowe Explorer puts datasets, Unix files and jobs in three trees inside VS Code, and the Zowe CLI does the same from a terminal or script. Language extensions such as IBM Z Open Editor add COBOL, PL/I and JCL understanding on top.

Three trees in VS Code

Zowe Explorer adds a side panel with three views. Each one starts empty; you add a profile and then a filter so you only see what you need.

ViewWhat you filter onWhat you can do
Data SetsA pattern such as USER1.** or PAY.TEST.*Open and edit members and sequential datasets, create, copy, rename, delete, submit JCL
Unix System ServicesA directory path such as /u/user1Open and edit files, create directories, change tags and permissions
JobsOwner, prefix or job IDSee status and return code, open spool files, cancel or purge jobs

When you open a member, Zowe Explorer downloads a copy to your PC and opens it in an editor tab. When you save, it uploads the copy back. Recent versions also check whether the member changed on the mainframe since you opened it and offer to compare before overwriting, which matters when two people edit the same member.

The same work from the CLI

The Zowe CLI uses the same profiles. Commands are grouped: zos-files for datasets and Unix files, zos-jobs for jobs and spool. Short aliases such as files and jobs also work.

Everyday Zowe CLI commands (illustrative)
$ zowe zos-files list data-set "USER1.*"
USER1.COBOL
USER1.JCL
USER1.LOADLIB
 
$ zowe zos-files download data-set "USER1.COBOL(PAYCALC)" -f paycalc.cbl
Data set downloaded successfully.
 
$ zowe zos-files upload file-to-data-set paycalc.cbl "USER1.COBOL(PAYCALC)"
 
$ zowe zos-jobs submit data-set "USER1.JCL(COMPILE)" --view-all-spool-content
jobid: JOB04521   retcode: CC 0004

--view-all-spool-content waits for the job to finish and prints every spool file, which is handy in a script. You can also list a job's spool files with zowe zos-jobs list spool-files-by-jobid and fetch one with zowe zos-jobs view spool-file-by-id. Unix files are handled with commands such as zowe zos-files list uss-files "/u/user1" and zowe zos-files upload file-to-uss.

Run zowe --help or add --help to any command; the help is detailed and includes examples. Exact options can change between Zowe versions, so check the help for the version your team uses.

Text, binary and code pages

Dataset content is EBCDIC; your PC uses ASCII or UTF-8. By default Zowe transfers in text mode, converting code pages on the way. Load modules, packed decimal data and other non-text content must be transferred in binary mode (the --binary option on the CLI), or the bytes are corrupted. For Unix files the file's tag also affects how they are treated.

Language support: IBM Z Open Editor and others

Zowe Explorer moves files; it does not understand COBOL. For that you add a language extension. IBM Z Open Editor provides syntax highlighting, code completion, an outline view, problem markers and copybook navigation for COBOL, PL/I, HLASM, REXX and JCL. Broadcom's Code4z pack offers a comparable set of open-source extensions. Both work alongside Zowe Explorer. Feature sets and licensing differ by product and version, so your site will usually pick one.

To resolve copybooks, the editor has to know where to find them: in a local folder of your Git clone, or in a dataset on z/OS. Z Open Editor uses a project file (zapp.yaml) with property groups that list those locations; other extensions have their own settings.

A typical VS Code setup
Language extensionZ Open Editor or Code4z: understands COBOL, JCL
Zowe Explorerdatasets, USS files, jobs
Git and the pipelineversion control and builds
z/OSMF on z/OSREST back end
TRY IT YOURSELF

Which Zowe CLI option transfers a dataset without code page conversion?

Show a hint

The opposite of text mode.

Show the solution

--binary (alias -b) transfers the bytes exactly, which is required for load modules and packed data.

Common mistakes

Transferring binary data in text mode

Text mode converts each byte between code pages, which corrupts packed decimal, binary fields and load modules. Use binary mode for anything that is not plain text.

Assuming an open tab holds a lock

Zowe edits are download, edit, upload. Someone else can change the member meanwhile; read the compare prompt instead of overwriting blindly.

Expecting Zowe Explorer to check COBOL

It moves files. Syntax checking and copybook navigation come from a language extension that has been told where copybooks live.

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
← What Zowe is and how it connectsGit workflows for mainframe source →