-2

Rexx code to change word in jcl and submit.

There is a JCL code. Requirement is to run the job after doing "C ALL JOB1 JOB2".

deepaklearner
  • 151
  • 1
  • 6
  • 22

1 Answers1

1

There are several ways of doing it. I would suggest ISPF skeltons

ISPF Skelton

The rexx is

ADDRESS TSO "ALLOC DD(OUTSKEL) DS('"OUTSKPDS"') SHR"
job="job2" /* job1 */
'FTOPEN'
'FTINCL SAMPSKEL'
'FTCLOSE LIBRARY(OUTSKEL) NAME('WORKMEM')'

The Skeleton becomes

//&job. job

see Executing a DFSORT using REXX

Edit Macro

You could use an edit macro. The rexx

'address ispexec edit dataset(my.job.to.edit) macro(mymacro)'

and the macro is roughly

address isredit 'macro' 
address isredit 'c job1 job2 all'
address isredit 'sub'

Read/write

Jou could read the JCL line by line, change each line as required and write a new JCL dataset file

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38