Zowe
Published in

Zowe

How to Store Zowe CLI Arguments in Team Config

{Core} Although we’ve seen how to quickly allocate data sets with custom attributes before, we can replicate this process in a simpler way using The Open Mainframe Project’s Zowe CLI’s project config that is provided with vNext. To download vNext see Installing the Zowe CLI @next version.

Let’s get started by storing some of our command line options within zowe.config.json.

Before & After

The goal is to take a long command with lots of arguments:
zowe files create pds "ibmuser.fb81.demo" --record-format FB --record-length 81 --block-size 162 --primary-space 2 --secondary-space 2 --directory-blocks 5 --show-attributes

And achieve the same result with something shorter (and easier to remember):

zowe files create pds "ibmuser.fb81.demo" --zosmf-p zosmf.fb81

It only takes 3 steps!

Step 0: zowe config init

Run zowe config init to create a boilerplate config file:

Step 1: Determine Arguments

Since we’re allocating data sets, we need to see which arguments to put in our config. Use help, e.g. zowe files create pds --help:

There are a lot 😃

For each argument we want to store in our zowe.config.json we need to transform the command line option syntax to a camel case variable name, e.g.: --record-format — >recordFormat

Step 2: Nest Properties in Config

Add the camel case options to your zowe.config.json, nested under a zosmf profile:

Because everyone wants a LRECL 81 data set

End Result

Instead of long commands with lots of options, we can store those in our zowe.config.json and share with other members in your team(s):

Conclusion

You can apply this same approach with other commands or Zowe CLI plugins which accept a lot of arguments and share values via zowe.config.json. Please comment or ask questions below!

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.

--

--

--

Zowe is the modern open source interface for the mainframe and z/OS. The Zowe blog has how-to’s, tips & tricks and other helpful insights for mainframe devops. Zowe is a project within the Linux Foundation’s Open Mainframe Project (OMP). Download @ Zowe.org.

Recommended from Medium

Reactive programming — Networking with Combine and RxSwift

Wanna Be A Web Developer? Learn the Lingo

Graph Theory w/ Google Maps

WEB DEVELOPMENT SERIES(PART - 2)

How to Replace Title with Image as an Icon Button on appBar in Flutter

VirtualBox Windows 10 and Hashes

Why Equals is a Powerful Operator To Help You Write Cleaner Code

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dan Kelosky

Dan Kelosky

Likes programming/automation in mainframe (assembler, C/C++), distributed (Node.js), and web development (Firebase, Angular).

More from Medium

Developing Containers on zCX

A matrix of shipping containers.

IntelliJ for Mainframe Powered By Zowe

Versioning, Managing, and Automating Db2 DDL Changes with Endevor

Access ADLS G2 with Unix Filesystem Commands Part 1