0

I have a lot of similar scripts written on IBM language, and I need to parse it, group and create templates for groups with variables instead of diffs.

For example:

//GENER1     EXEC PGM=IEBGENER
//SYSPRINT  DD SYSOUT=*
//SYSUT1    DD *
PROC_AUTO_RECOVER=YES
PROC_AUTO_RECOVER_BCV=(NONE,NONE)
PROC_AUTO_RECOVER_ITRK=30
//SYSUT2    DD DISP=SHR,DSN=%JCLLIB%(%PROC%)
//SYSIN     DD DUMMY

And

//GENER2     EXEC PGM=IEBGENER
//SYSPRINT  DD SYSOUT=*
//SYSUT1    DD *
PROC_AUTO_RECOVER=NO
PROC_AUTO_RECOVER_BCV=(YES,YES)
PROC_AUTO_RECOVER_ITRK=20
//SYSUT2    DD DISP=SHR,DSN=%JCLLIB%(%PROC%)
//SYSIN     DD DUMMY

are pretty similar, so they need to be grouped and produce template

//"name"     EXEC PGM=IEBGENER
//SYSPRINT  DD SYSOUT=*
//SYSUT1    DD *
"options"
//SYSUT2    DD DISP=SHR,DSN="options2"
//SYSIN     DD DUMMY

Is there a way to do that on python for example?

Xerocry
  • 79
  • 12
  • 2
    Do what in Python? Where are you going to execute this? What are you trying to achieve? A JCL procedure? A File Tailoring template? And what if you need the dats editing facility of IEBGENER rather than just the copy? You would then need SYSIN to point to a data set or raw control statements. – NicC Aug 14 '18 at 09:47
  • This question is unclear I don't really understand what you are trying to do and why it needs to be automated with Python. To answer your question, yes you can use Python to either create a text file with JCL in it, or submit the JCL via FTP. – SaggingRufus Aug 14 '18 at 10:11
  • I suspect `ISPF FileTailoring` may be what you are after. Have a look at https://stackoverflow.com/questions/51240074/executing-a-dfsort-using-rexx – Bruce Martin Aug 19 '18 at 01:05
  • To clarify, it sounds like you want to feed multiple JCL examples through a tool and have the tool recognize patterns and generate template based on the provided samples? There are ways of using templates like described by @BruceMartin but I'm not aware of a tool that analyzes multiple samples and creates the templates. – Hogstrom Aug 19 '18 at 13:18
  • @Hogstrom Yes, I mean that, sorry for trouble. I'm not looking for existed tool, I just want some advises on algorithm for that and maybe the most suitable language. – Xerocry Aug 20 '18 at 18:27
  • Doesn't hurt to ask for a pointer if your stuck. – Hogstrom Aug 20 '18 at 18:32

0 Answers0