The Linux Foundation Projects
Skip to main content
Blog | Zowe | Zowe User Stories

Using Zowe CLI to build and run a `Hello World` program written in High Level Assembler language

By | June 18, 2025

This article originally ran on the Zowe Medium blog. For the complete blog click here

Written by Dan Kelosky, Open Mainframe Project Ambassador, TAC representative and Principal Software Engineer at Broadcom

My first Open Mainframe Project 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:

  1. Although the “Hello World” applied to Zowe and not HLASM the sample HLASM code was over 1000 lines long
  2. Many scripts (8 in total) were needed because Zowe CLI had limited features
  3. 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

Snapshot of the HLASM code found @ https://github.com/dkelosky/assembler-metal-template/blob/v6/zossrc/template.s

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 the zossrc 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.

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 runs make

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

Building & running the program from a workstation terminal

Note: if you don’t see +HELLO WORLD when following along, you probably need to add export _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 check out 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.