Skip to content

Commit

Permalink
ZWEGEN00 split CONFIG entry over multiple lines (#3873)
Browse files Browse the repository at this point in the history
* WIP to have ZWEGEN00 split CONFIG entry over multiple lines.

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update CONFIG= for launcher

Signed-off-by: Martin Zeithaml <[email protected]>

* Simplify macro

Signed-off-by: Martin Zeithaml <[email protected]>

* Update SMPMCS.txt

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update SMPMCS.txt

Signed-off-by: 1000TurquoisePogs <[email protected]>

---------

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: Martin Zeithaml <[email protected]>
Co-authored-by: Martin Zeithaml <[email protected]>
  • Loading branch information
1000TurquoisePogs and Martin-Zeithaml authored Jun 26, 2024
1 parent 716caf1 commit 9188de0
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 24 deletions.
109 changes: 86 additions & 23 deletions files/SZWEEXEC/ZWEGEN00
Original file line number Diff line number Diff line change
Expand Up @@ -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)

/*
================================================================================
Expand All @@ -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
Expand All @@ -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

/*
================================================================================
Expand Down Expand Up @@ -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

/*
Expand Down Expand Up @@ -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
Expand All @@ -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

/*
================================================================================
Expand Down
7 changes: 7 additions & 0 deletions files/SZWEEXEC/ZWEINS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* REXX */
address isredit 'macro'
do i = 1 to queued()
parse pull insertCmd
address isredit insertCmd
end
address isredit 'end'
2 changes: 1 addition & 1 deletion files/SZWESAMP/ZWEGENER
Original file line number Diff line number Diff line change
Expand Up @@ -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 <full path to zowe.yaml file>
FILE {zowe.runtimeDirectory}/files/defaults.yaml
Expand Down
1 change: 1 addition & 0 deletions smpe/bld/SMPMCS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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) .
Expand Down

0 comments on commit 9188de0

Please sign in to comment.