Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JCL header in SZWESAMP templates #3934

Open
Martin-Zeithaml opened this issue Aug 13, 2024 · 8 comments
Open

JCL header in SZWESAMP templates #3934

Martin-Zeithaml opened this issue Aug 13, 2024 · 8 comments
Labels
Config Manager Related to the config manager component question Further information is requested

Comments

@Martin-Zeithaml
Copy link
Contributor

Martin-Zeithaml commented Aug 13, 2024

Problem: my ESM does not allow me to run a job without an account number.

Simple JOB statement
1 line JOB statement could be done with combination of defaults.yaml and templating:

  • defaults.yaml
    • zowe.environments.jcl1LineHeader=''
  • The template:
    • //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:

//ZWEJOB JOB (800,'Skynet cleaning services'),
//      'Cyberdyne T-800',
//      NOTIFY=(SKYNET.HQ)

or this?

//ZWEJOB JOB (800,'Skynet cleaning services'),
//      'Cyberdyne T-800',NOTIFY=(SKYNET.HQ)

Note: This feature depends on #3718.

Another limitation:
Varibale names in ZWEGEN00 must be unique comparing to zowe config, e.g:

zowe:
  environments:
    jcl:
      header: '1234'

was resolved to:

change all {zowe.environments.jcl.header} 'CFG.ZOWE.ENVIRONMENTS.MARTIN.ZOWE.PR#3718.SZWESAMP.HEADER'

Because the rexx variable jcl exists and points to jcllib dataset. 😄

@Martin-Zeithaml Martin-Zeithaml added question Further information is requested Config Manager Related to the config manager component labels Aug 13, 2024
@JoeNemo
Copy link
Contributor

JoeNemo commented Aug 14, 2024

@jordanfilteau1995 Do you (or Judy) know any way to allow subsititution into fixed-80 languages (like JCL, REXX) to properly handle line wrap?

@Martin-Zeithaml
Copy link
Contributor Author

Implementation idea:

  1. defaults.yaml contains zowe.environments.jclHeader=''
    a) Set it under zowe.environment or zowe.setup?
  2. All samples will be coded with //ZWExxxx JOB {zowe.environments.jclHeader}
  3. 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.

@JoeNemo
Copy link
Contributor

JoeNemo commented Aug 28, 2024

Ok, so we are NOT doing multiline.

@jordanfilteau1995
Copy link
Contributor

jordanfilteau1995 commented Aug 28, 2024

Hi. I think there's an easier solution. You can:

  1. Make an array of strings in YAML to be and schema enforce to 80-character limit which will correspond to lines in the job card.
  2. Create a step in ZWEGEN00 to handle this.
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

@MarkAckert
Copy link
Member

MarkAckert commented Aug 28, 2024

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.

@jordanfilteau1995
Copy link
Contributor

Good point! Should not include it and then skip the first line after reading the file to not overwrite it.

@Martin-Zeithaml
Copy link
Contributor Author

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

@MarkAckert
Copy link
Member

Adding another potential requirement: while using the z/OSMF configuration workflow, can we pass the job card defined in z/OSMF to the templates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Config Manager Related to the config manager component question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants