Using Zowe CLI to build and run a `Hello World` program written in High Level Assembler language.
{Core}
My first Open Mainframe Project Zowe blog was a “Hello World”-Zowe example written 6 years ago. It covered an approach to developing IBM High Level Assembler (HLASM) with Zowe CLI.
Rereading this approach 6 years later, I’m pleased to see that the general concept is still valid. However, my original approach was too complicated!
For example:
- Although the “Hello World” applied to Zowe and not HLASM the sample HLASM code was over 1000 lines long
- Many scripts (8 in total) were needed because Zowe CLI had limited features
- JCL was used for build/run but it complicated deployment
Below we’ll look at a shorter, simpler version to achieve something interesting with Zowe CLI: build and run a “Hello World” HLASM program.
Less HLASM Code
This new code found here is not the simplest way possible to write “hello world” in HLASM. However, it’s ~900 lines shorter than the previous example and still demonstrates mostly good techniques (although it will likely be scrutinized by an interested community 😀).
No Scripts
At the time of writing the original blog, zowe
CLI didn’t have as many features as it does today. So, in order to achieve interesting operations, you typically needed to wrap multiple zowe
CLI commands into a script.
Instead, we can run a handful of zowe
CLI commands directly (assuming you have it installed and configured):
zowe ssh issue command "mkdir -p /tmp/somedir/template"
— creates a location in z/OS UNIX to build & run “hello world”zowe files upload dtu zossrc /tmp/somedir/template
— uploads thezossrc
directory and contents from a local workstation to/tmp/somedir/template

No JCL
Here we’ll use a basic makefile
and run the test program under z/OS UNIX.
ASM = as
BIND = ld
template: template.o
$(BIND) -brmode=any -V -eTEMPLATE -o $@ $^ > $*.bind.lst
template.o: template.s
$(ASM) -mrent -a=$*.asm.lst -I. -o $@ $^
Note: default macro data sets (like
SYS1.MACLIB
) are included, but you can include others via-Isome.macro.data.set
.
To build, invoke make
:
zowe ssh issue command “cd /tmp/somedir/template && make"
— switches to your z/OS UNIX source directory and runsmake
To run, invoke the template program:
zowe ssh issue command “cd /tmp/somedir/template && make && ./template"
— switches to your z/OS UNIX source directory and runs./template

Note: if you don’t see
+HELLO WORLD
when following along, you probably need to addexport _BPXK_JOBLOG=STDERR
to you z/OS UNIX.profile
.
Recap
This is a starting point for using Zowe CLI to build and run simple HLASM programs. zowe files upload ...
is the only command which requires z/OSMF prerequisite on your mainframe system. The remaining commands are executed via an SSH connection which is built into zowe
CLI. If you don’t have access to z/OSMF, you can alternatively use ftp
, sftp
, or your favorite alternative to transfer files to your z/OS UNIX system.
If you enjoyed this blog checkout more Zowe blogs here. Or, ask a question and join the conversation on the Open Mainframe Project Slack Channel #Zowe-dev, #Zowe-user or #Zowe-onboarding. If this is your first time using the Open Mainframe Project Slack Channel register here.