Building a STEPLIB environment: The STEPLIB environment variable

Traditionally, some MVS™ users have preferred to alter the search order for MVS executable files when they are running a new or test version of an application program, such as a runtime library. To do this, they code a STEPLIB DD statement on the JCL used to run the application. Accessed ahead of LINKLIB or LPALIB, a STEPLIB is a set of private libraries where the new or test version of the application is stored.

The STEPLIB environment variable provides the ability to use a STEPLIB when running a z/OS UNIX executable file. This variable is used to determine how to set up the STEPLIB environment for an executable file.

You can set the variable in one of three ways:
Table 1. Three ways to set the STEPLIB environment variable (tcsh shell)
Statement Action
setenv STEPLIB CURRENT Passes on any currently active TASKLIB, STEPLIB, or JOBLIB allocations from the invoker's MVS program search order environment to the environment created for the executable file to run in. Any STEPLIB environment in the invoker's process image is re-created in the new process image for the executable file when the file is invoked. This is the default value that is set if no STEPLIB variable is specified.

If an application uses fork(), spawn(), or exec(), the STEPLIB data sets must be cataloged.

setenv STEPLIB NONE Specifies that no STEPLIB environment should be set up for executable files.
setenv STEPLIB DSN1:DSN2:DSN3 Sets up a library search order for the STEPLIB, in the order that the data sets are specified. You can specify up to 255 fully qualified data set names, separated by colons. For example:
setenv STEPLIB SMITH.C.LOADLIB:SMITH.PL1.LOADLIB

The specified data sets must be cataloged MVS load libraries that you have security access to. The data sets specified here are built into a STEPLIB environment for the executable file.