Open Martin-Zeithaml opened 1 month ago
@jordanfilteau1995 Do you (or Judy) know any way to allow subsititution into fixed-80 languages (like JCL, REXX) to properly handle line wrap?
Implementation idea:
defaults.yaml
contains zowe.environments.jclHeader=''
a) Set it under zowe.environment
or zowe.setup
?//ZWExxxx JOB {zowe.environments.jclHeader}
zwe init generate
will check the header and replace it before submitting ZWEGENER
a) the rest of the headers will be replaced by ZWEGEN00
The default behavior is the same, without any additional changes to zowe.yaml
, after running ZWEGEN00
there will be always only //ZWExxxx JOB
for all samples.
Ok, so we are NOT doing multiline.
Hi. I think there's an easier solution. You can:
zowe:
jobCard:
- //ZWExxxx JOB BLAHBLAH
- // blah
pseudo code below
read YAML job card into jobCard
for all members:
read member into a stem fileContents
create a new stem newFile
loop jobCard
contents into newFile
stem and store the ending index
loop fileContents
starting at the ending index until you have newFile
with the old file contents after the job card
write newFile
to member
I like the array of fixed-length strings representing multiple header lines, however, I think we should leave out the //ZWExxx JOB
portion of the first line and reduce the per-line length limit to adjust accordingly. Users don't need to customize the jobname and leaving it out simplifies some of the implementation work.
Good point! Should not include it and then skip the first line after reading the file to not overwrite it.
I have this working POC and it is just couple lines added to #3951
1) You will define your jcl statement as one string. If you need multiline, use \n
(rexx does not know about arrays)
2) zwe init generate
checks, if it is one or more lines
a) One line will be done directly by REXX ZWEGEN00
b) Multiline will be done by postprocessing in zwe init generate
Templates remain the same:
//ZWExxxx JOB {jclHeader}
Yaml | Result |
---|---|
No jclHeader |
//ZWExxxx JOB |
jclHeader=1234 |
//ZWExxxx JOB 1234 |
jclHeader=1234,\n// NOTIFY=&ALL |
//ZWExxxx JOB 1234, |
// NOTIFY=&ALL |
Adding another potential requirement: while using the z/OSMF configuration workflow, can we pass the job card defined in z/OSMF to the templates?
Problem: my ESM does not allow me to run a job without an account number.
Simple
JOB
statement 1 lineJOB
statement could be done with combination ofdefaults.yaml
and templating:defaults.yaml
zowe.environments.jcl1LineHeader=''
//ZWEJOB JOB {zowe.environments.jcl1LineHeader}
And user can specify or omit the variable:
zowe.yaml
zowe.environments.jcl1LineHeader="123456,'My name'"
When processed by
ZWEGENER
, the result will be one of://ZWEJOB JOB
//ZWEJOB JOB 123456,'My name'
But how to do multiline?
What if I want to have this:
or this?
Note: This feature depends on #3718.
Another limitation: Varibale names in
ZWEGEN00
must be unique comparing to zowe config, e.g:was resolved to:
Because the rexx variable
jcl
exists and points tojcllib
dataset. 😄