Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @zowe/zos-tso-for-zowe-sdk

z/OS TSO Package

Contains APIs to interact with TSO on z/OS (using z/OSMF TSO REST endpoints).

API Examples

Issue the TSO command "status" to display info about jobs for your user ID

import { ProfileInfo } from "@zowe/imperative";
import { IssueTso } from "@zowe/zos-tso-for-zowe-sdk";

(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

    // Load account number from default TSO profile (optional)
    const tsoProfAttrs = profInfo.getDefaultProfile("tso");
    const tsoMergedArgs = profInfo.mergeArgsForProfile(tsoProfAttrs);
    const accountNumberFromProfile = tsoMergedArgs.knownArgs.find(
        arg => arg.argName === "account").argValue as string;

    const accountNumber = accountNumberFromProfile || "ACCT#";
    const command = "status";
    const response = await IssueTso.issueTsoCommand(session, accountNumber, command);
    if (response.success) {
        console.log(response);
    } else {
        throw new Error(`Failed to issue TSO command "${command}"`);
    }
})().catch((err) => {
    console.error(err);
    process.exit(1);
});

Demonstrate starting, pinging, and stopping a TSO address space

import { ProfileInfo } from "@zowe/imperative";
import { PingTso, StartTso, StopTso } from "@zowe/zos-tso-for-zowe-sdk";

(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

    const accountNumber = "ACCT#";
    const startResponse = await StartTso.start(session, accountNumber, {
        codePage: "285"
    });

    const servletKey = startResponse.servletKey;
    if (startResponse.success) {
        console.log(`[${servletKey}] Started`);
    } else {
        throw new Error("Failed to start TSO address space");
    }

    const pingResponse = await PingTso.ping(session, servletKey);
    if (pingResponse.success) {
        console.log(`[${servletKey}] Ping succeeded`);
    } else {
        throw new Error("Failed to ping TSO address space");
    }

    const stopResponse = await StopTso.stop(session, servletKey);
    if (stopResponse.success) {
        console.log(`[${servletKey}] Stopped`);
    } else {
        throw new Error("Failed to stop TSO address space");
    }

    try {
        await PingTso.ping(session, servletKey);
    } catch {
        console.log(`[${servletKey}] Ping failed`);
    }
})().catch((err) => {
    console.error(err);
    process.exit(1);
});

Index

Type aliases

SendResponse

SendResponse: (response: ISendResponse) => void

Type declaration

Object literals

Const ZosTsoProfile

ZosTsoProfile: object

Profile configuration for TSO profiles

memberof

ZosTsoProfile

createProfileExamples

createProfileExamples: { description: string; options: string }[] = [{description: "Create a tso profile called 'myprof' with default settings and JES accounting information of 'IZUACCT'",options: "myprof -a IZUACCT"},{description: "Create a tso profile called 'largeregion' with a region size of 8192, a logon procedure of MYPROC, and " +"JES accounting information of '1234'",options: "largeregion -a 1234 --rs 8192"},{description: "Create a tso profile called 'myprof2' with default settings and region size of 8192, without storing the user " +"account on disk",options: "myprof2 --rs 8192"}]

type

type: string = "tso"

updateProfileExamples

updateProfileExamples: { description: string; options: string }[] = [{description: "Update a tso profile called myprof with new JES accounting information",options: "myprof -a NEWACCT"}]

schema

schema: object

description

description: string = "z/OS TSO/E User Profile"

required

required: undefined[] = []

title

title: string = "TSO Profile"

type

type: string = "object"

properties

properties: object

account

account: object

includeInTemplate

includeInTemplate: boolean = true

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_ACCOUNT_PROFILE

type

type: string = "string"

characterSet

characterSet: object

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_CHAR_SET

type

type: string = "string"

codePage

codePage: object

includeInTemplate

includeInTemplate: boolean = true

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_CODE_PAGE

type

type: string = "string"

columns

columns: object

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_COLUMNS

type

type: string = "number"

logonProcedure

logonProcedure: object

includeInTemplate

includeInTemplate: boolean = true

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_LOGON_PROCEDURE

type

type: string = "string"

regionSize

regionSize: object

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_REGION_SIZE

type

type: string = "number"

rows

rows: object

optionDefinition

optionDefinition: any = TsoProfileConstants.TSO_OPTION_ROWS

type

type: string = "number"

Const noAccountNumber

noAccountNumber: object

No account number was provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No account number was supplied.`

Const noCommandInput

noCommandInput: object

No command text was provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No command text was provided.`

Const noDataInput

noDataInput: object

No data parameter string was supplied error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No data parameter string was supplied.`

Const noPingInput

noPingInput: object

No servlet key was provided for Ping command error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No servlet supplied.`

Const noServletKeyInput

noServletKeyInput: object

No servlet key was provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No servlet key was supplied.`

Const noSessionTso

noSessionTso: object

No Session provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No session was supplied.`

Const noTsoIssueInput

noTsoIssueInput: object

No input parameters were provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No tso issue command parameters were supplied.`

Const noTsoStartInput

noTsoStartInput: object

No input parameters were provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No tso start address space parameters were supplied.`

Const noTsoStopInput

noTsoStopInput: object

No input parameters for stop were provided error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No tso stop address space parameters were supplied.`

Const noZosmfResponse

noZosmfResponse: object

No ZOSMF response was received error message

static
memberof

TsoConstants

message

message: string = apiErrorHeader.message + ` No z/OSMF response was received.`

Generated using TypeDoc