diff --git a/files/SZWEEXEC/ZWEGEN00 b/files/SZWEEXEC/ZWEGEN00 index 9a1773cea6..b0c0078299 100644 --- a/files/SZWEEXEC/ZWEGEN00 +++ b/files/SZWEEXEC/ZWEGEN00 @@ -35,8 +35,11 @@ parse arg operation verbosity */ schemaChain = GetSchemaChain() + +runtime = GetRuntimeDirectory() +defaultYaml = 'FILE('runtime'/files/defaults.yaml)' configChain = GetConfigChain() -configChainWithMembers = GetConfigChainWithMembers() +configChain = AddToChain(configChain, defaultYaml) /* ================================================================================ @@ -48,6 +51,11 @@ if Validate(schemaChain, configChain) > 0 then do ExitWithRC(8) end +if runtime = '' then do + say 'Runtime directory not found.' + ExitWithRC(8) +end + /* ================================================================================ If we should generate jcl, then use ConfigMgr to get the configuration @@ -74,7 +82,6 @@ end CFG.zwe.header.user = USERID() CFG.zwe.header.date = TRANSLATE(DATE(), '-', ' ') CFG.zwe.header.time = TIME() -CFG.ZWE_CLI_PARAMETER_CONFIG = configChainWithMembers /* ================================================================================ @@ -404,6 +411,74 @@ if card.0 > 0 then do say 'The job card was added to each member.' end + + +say 'Checking the ZWESLSTC CONFIG entry' + +if AllocateDataSet(jclCopy'(ZWESLSTC)', 'zwejcl') > 0 then do + ExitWithRC(8) +end +if ReadFromDataSet('zwejcl') > 0 then do + ExitWithRC(8) +end +if FreeByDD('zwejcl') > 0 then do + ExitWithRC(8) +end +do j = 1 to !contentToRead.0 + cmp1 = COMPARE(!contentToRead.j, 'CONFIG={ZWE_CLI_PARAMETER_CONFIG}') + cmp2 = COMPARE(!contentToRead.j, 'CONFIG=CFG.ZWE_CLI_PARAMETER_CONFIG') + if cmp1 = 0 | cmp2 = 0 then do + say 'Defining CONFIG entry for ZWESLSTC' + currentline = j + if ReadFromDataSet('myconfig') = 0 then do + do j = 1 to !contentToRead.0 + type = WORD(!contentToRead.j, 1) + location = WORD(!contentToRead.j, 2) + element = type'('location')' + if COMPARE(type, 'PARMLIB') = 0 then do + element = 'PARMLIB('location'(ZWEYAML))' + end + if j = 1 then do + cmd = 'LINE 'currentline' = "CONFIG='element + if !contentToRead.0 > 1 then do + cmd = cmd':\"' + end + else do + cmd = cmd'"' + end + call Print ' 'cmd + queue cmd + end + else do + if j > 2 then do + currentline = currentline + 1 + end + cmd = 'LINE_AFTER 'currentline' = "'element + if !contentToRead.0 > j then do + cmd = cmd':\"' + end + else do + cmd = cmd'"' + end + call Print ' 'cmd + queue cmd + end + end + cmd = 'edit dataset('"'"jclCopy'(ZWESLSTC)'"'"') macro(zweins)' + call Print cmd + address ispexec cmd + if RC <= 4 then do + call Print 'Insert successful.' + end + else do + say 'Defining CONFIG entry for ZWESLSTC failed.' + ExitWithRC(8) + end + end + leave + end +end + exit /* @@ -804,9 +879,6 @@ FreeByDSN: type = WORD(!contentToRead.j, 1) location = WORD(!contentToRead.j, 2) element = type'('location')' - if COMPARE(type, 'PARMLIB') = 0 then do - elementWithMember = 'PARMLIB('location'(ZWEYAML))' - end configChain = AddToChain(configChain, element) end end @@ -815,30 +887,21 @@ FreeByDSN: /* ================================================================================ - GetConfigChainWithMembers() + GetRuntimeDirectory() ================================================================================ */ - GetConfigChainWithMembers: - procedure expose !verbose +GetRuntimeDirectory: - configChain = '' + runtime = '' - if ReadFromDataSet('myconfig') = 0 then do - do j = 1 to !contentToRead.0 - type = WORD(!contentToRead.j, 1) - location = WORD(!contentToRead.j, 2) - if COMPARE(type, 'PARMLIB') = 0 then do - element = 'PARMLIB('location'(ZWEYAML))' - end - else do - element = type'('location')' - end - configChain = AddToChain(configChain, element) - end + if ReadFromDataSet('myschema') = 0 then do + type = WORD(!contentToRead.1, 1) + location = WORD(!contentToRead.1, 2) + offset = INDEX(location, '/schemas/zowe-yaml-schema.json') + runtime = SUBSTR(location, offset) end - return configChain - + return runtime /* ================================================================================ diff --git a/files/SZWEEXEC/ZWEINS b/files/SZWEEXEC/ZWEINS new file mode 100644 index 0000000000..b101143796 --- /dev/null +++ b/files/SZWEEXEC/ZWEINS @@ -0,0 +1,7 @@ +/* REXX */ +address isredit 'macro' +do i = 1 to queued() + parse pull insertCmd + address isredit insertCmd +end +address isredit 'end' diff --git a/files/SZWESAMP/ZWEGENER b/files/SZWESAMP/ZWEGENER index f2b880ed1f..2cd5173009 100644 --- a/files/SZWESAMP/ZWEGENER +++ b/files/SZWESAMP/ZWEGENER @@ -72,7 +72,7 @@ $$ //* Do not remove the defaults.yaml entry. //* //* Ex. PARMLIB MY.ZOWE.CUSTOM.PARMLIB -//* FILE /the/zowe/defaults.yaml +//* FILE /some/other/zowe.yaml //MYCONFIG DD *,DLM=$$ FILE FILE {zowe.runtimeDirectory}/files/defaults.yaml diff --git a/smpe/bld/SMPMCS.txt b/smpe/bld/SMPMCS.txt index 76499349d8..4faee84ef7 100755 --- a/smpe/bld/SMPMCS.txt +++ b/smpe/bld/SMPMCS.txt @@ -30,6 +30,7 @@ ++SAMP(ZWE7APLY) SYSLIB(SZWESAMP) DISTLIB(AZWESAMP) RELFILE(1) . ++SAMP(ZWE8ACPT) SYSLIB(SZWESAMP) DISTLIB(AZWESAMP) RELFILE(1) . ++SAMP(ZWECHG) SYSLIB(SZWEEXEC) DISTLIB(AZWESAMP) RELFILE(2) . +++SAMP(ZWEINS) SYSLIB(SZWEEXEC) DISTLIB(AZWESAMP) RELFILE(2) . ++SAMP(ZWEGEN00) SYSLIB(SZWEEXEC) DISTLIB(AZWESAMP) RELFILE(2) . ++SAMP(ZWEMCOPY) SYSLIB(SZWEEXEC) DISTLIB(AZWESAMP) RELFILE(2) . ++SAMP(ZWEOCOPY) SYSLIB(SZWEEXEC) DISTLIB(AZWESAMP) RELFILE(2) .