Launching a z/OS User Program

In order to communicate with a z/OS user program, the program must first be launched.

To launch a z/OS user program:

IZOSHost zosHost = ...
String userID = ...
String password = ...
String userProcedureName = ...
String userProgramName = ...

// use one of the several ZOSCredentialsFactory methods to create a z/OS
// credentials object
IZOSCredentials credentials = ZOSCredentialsFactory
        .createZOSCredentials(userID, password);

// create a z/OS user program connection from the z/OS host
IZOSUserProgramConnection zosUserProgramConnection = zosHost

try {
    // launch the z/OS user program
            userProcedureName, userProgramName);

    // the z/OS user program connection is now able to communicate with the
    // program (for as long as it remains running)
} catch (HostCredentialsException e) {
    // credentials were invalid, likely caused by incorrect login
    // information or expired password

When writing plug-ins running in a Workbench for Eclipse client, a z/OS user program can also be launched using the credentials of the currently logged in UI user using the ZOSUIUserCredentialsManager (to view a previous example, see Connecting to a z/OS host for data set or JES API usage).

Was this page helpful? Yes No Submitting... Thank you