From 41ecb104e57d9488ff5f6b64cae50527fc60890a Mon Sep 17 00:00:00 2001 From: Lukas Jaks Date: Tue, 21 Mar 2023 11:23:56 +0100 Subject: [PATCH 1/2] Message class support *Added message class for zwe start job. Message class parameter is being taken from configuration yaml Signed-off-by: LukasJaks --- bin/commands/start/index.sh | 7 +++++++ bin/commands/start/index.ts | 6 ++++++ schemas/zowe-yaml-schema.json | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/bin/commands/start/index.sh b/bin/commands/start/index.sh index a0ed1b47ad..c4ad60054a 100644 --- a/bin/commands/start/index.sh +++ b/bin/commands/start/index.sh @@ -45,6 +45,10 @@ sanitize_ha_instance_id if [ -n "${ZWE_CLI_PARAMETER_HA_INSTANCE}" ]; then route_sysname=$(read_yaml "${ZWE_CLI_PARAMETER_CONFIG}" ".haInstances.${ZWE_CLI_PARAMETER_HA_INSTANCE}.sysname") fi +msgclass= +if [ -z "${msgclass}" ]; then + jobname=$(read_yaml "${ZWE_CLI_PARAMETER_CONFIG}" ".zowe.job.msgclass") +fi ############################### # start job @@ -58,6 +62,9 @@ fi if [ -n "${route_sysname}" ]; then cmd="RO ${route_sysname},${cmd}" fi +if [ -n "${msgclass}" ]; then + cmd="${cmd},MSGCLASS=${msgclass}" +fi result=$(operator_command "${cmd}") code=$? if [ ${code} -ne 0 ]; then diff --git a/bin/commands/start/index.ts b/bin/commands/start/index.ts index f4e240c835..b48db5422d 100644 --- a/bin/commands/start/index.ts +++ b/bin/commands/start/index.ts @@ -31,6 +31,9 @@ export function execute() { securityStcsZowe=std.getenv('ZWE_PRIVATE_DEFAULT_ZOWE_STC'); } + //Read job message class + const msgclass = zoweConfig.zowe.job?.msgclass; + let routeSysname:string; config.sanitizeHaInstanceId(); @@ -50,6 +53,9 @@ export function execute() { if (routeSysname) { cmd=`RO ${routeSysname},${cmd}`; } + if (msgclass) { + cmd+=`,MSGCLASS=${msgclass}`; + } const shellReturn = zoslib.operatorCommand(cmd); if (shellReturn.rc) { diff --git a/schemas/zowe-yaml-schema.json b/schemas/zowe-yaml-schema.json index 7e1464bf3f..b9aeeec033 100644 --- a/schemas/zowe-yaml-schema.json +++ b/schemas/zowe-yaml-schema.json @@ -415,6 +415,10 @@ "prefix": { "type": "string", "description": "A short prefix to customize address spaces created by Zowe job." + }, + "msgclass": { + "type": "string", + "description": "Message class for Zowe job." } } }, From 55a3a2fb0766fbaff32e0ca228d1e24b40028193 Mon Sep 17 00:00:00 2001 From: Lukas Jaks Date: Tue, 21 Mar 2023 11:23:56 +0100 Subject: [PATCH 2/2] Message class example *Added message class example to zowe config yaml file Signed-off-by: LukasJaks --- bin/commands/start/index.sh | 7 +++++++ bin/commands/start/index.ts | 6 ++++++ example-zowe.yaml | 2 ++ schemas/zowe-yaml-schema.json | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/bin/commands/start/index.sh b/bin/commands/start/index.sh index a0ed1b47ad..c4ad60054a 100644 --- a/bin/commands/start/index.sh +++ b/bin/commands/start/index.sh @@ -45,6 +45,10 @@ sanitize_ha_instance_id if [ -n "${ZWE_CLI_PARAMETER_HA_INSTANCE}" ]; then route_sysname=$(read_yaml "${ZWE_CLI_PARAMETER_CONFIG}" ".haInstances.${ZWE_CLI_PARAMETER_HA_INSTANCE}.sysname") fi +msgclass= +if [ -z "${msgclass}" ]; then + jobname=$(read_yaml "${ZWE_CLI_PARAMETER_CONFIG}" ".zowe.job.msgclass") +fi ############################### # start job @@ -58,6 +62,9 @@ fi if [ -n "${route_sysname}" ]; then cmd="RO ${route_sysname},${cmd}" fi +if [ -n "${msgclass}" ]; then + cmd="${cmd},MSGCLASS=${msgclass}" +fi result=$(operator_command "${cmd}") code=$? if [ ${code} -ne 0 ]; then diff --git a/bin/commands/start/index.ts b/bin/commands/start/index.ts index f4e240c835..b48db5422d 100644 --- a/bin/commands/start/index.ts +++ b/bin/commands/start/index.ts @@ -31,6 +31,9 @@ export function execute() { securityStcsZowe=std.getenv('ZWE_PRIVATE_DEFAULT_ZOWE_STC'); } + //Read job message class + const msgclass = zoweConfig.zowe.job?.msgclass; + let routeSysname:string; config.sanitizeHaInstanceId(); @@ -50,6 +53,9 @@ export function execute() { if (routeSysname) { cmd=`RO ${routeSysname},${cmd}`; } + if (msgclass) { + cmd+=`,MSGCLASS=${msgclass}`; + } const shellReturn = zoslib.operatorCommand(cmd); if (shellReturn.rc) { diff --git a/example-zowe.yaml b/example-zowe.yaml index 888da55b59..26ea98a89a 100644 --- a/example-zowe.yaml +++ b/example-zowe.yaml @@ -311,6 +311,8 @@ zowe: name: ZWE1SV # Prefix of component address space prefix: ZWE1 + # Zowe JCL job message class + msgclass: "5" # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # This is an ID you use to separate multiple Zowe installs when determining diff --git a/schemas/zowe-yaml-schema.json b/schemas/zowe-yaml-schema.json index 7e1464bf3f..b9aeeec033 100644 --- a/schemas/zowe-yaml-schema.json +++ b/schemas/zowe-yaml-schema.json @@ -415,6 +415,10 @@ "prefix": { "type": "string", "description": "A short prefix to customize address spaces created by Zowe job." + }, + "msgclass": { + "type": "string", + "description": "Message class for Zowe job." } } },