I want to take input from User, and then Run some particular steps that many times in a JCL. Can it be possible ?
-
Can you explain a bit more, please? Why would running a step multiple times help? – Bill Woodger Mar 10 '14 at 10:50
-
Hi Bill, There is some task in which there can be any number of instances for which i have to run a particular step. I am making a general proc, which anyone can use in my company. In different applications, there are different number of times they want to run. So, was thinking according to that. – GeekyGeek Mar 12 '14 at 08:00
4 Answers
JCL does not have any looping / go to structures, so No.
Normally on the Mainframe you would generate a job with multiple steps (or multiple jobs / multiple steps. I would strongly suggest talking to people where you work to see how it this is normally done.
But basically you generate multiple jobs / steps as required. in particular:
TSO / SPF - In TSO/ISPF there is ISPF File Tailoring for this. In particular look at ISPF Table creation in rexx and the )DOT (Do Table) and )ENDDOT spf skelton controls (see )DOT statement in ISPF Skelton control statements).
For CICS / IMS DC the normal process would be to
- Submit a job that submits a schedule in what ever scheduling system being use
- Generate the job / jobs
- run the generated jobs
You could run the required steps in rexx
you can have multiple steps and use if/cond to execute the correct number of steps
//STEPCHK EXEC PGM=... Program to convert parameter to return code // EXEC ...,COND=(0,lt,STEPCHK) // EXEC ...,COND=(1,lt,STEPCHK) // EXEC ...,COND=(2,lt,STEPCHK) // EXEC ...,COND=(3,lt,STEPCHK) // EXEC ...,COND=(4,lt,STEPCHK) ... // EXEC ...,COND=(n,lt,STEPCHK)
For Rexx, A simple program that accepts the number of steps would be
parse arg numberOfSteps
Address ISPEXEC
'ftopen'
'ftincl jclstart'
do i=1 to numberOfSteps
'ftincl jclstep'
end
'ftclose name(member)'
SPF skeltons are basically members of the PDS with required text. Variables (start with & length upto 8 chars normally terminated by .) + various controls (e.g. )SEL etc)

- 10,358
- 1
- 27
- 38
-
Hi Bruce, Thanks for your valuable time. I dont know much about ISPF File Tailoring or REXX, trying to learn now. Can you please guide how should i learn all these ? And my Project is not related to CICS/IMS DC. – GeekyGeek Mar 12 '14 at 08:03
Not with just JCL, no. JCL has no looping constructs. You could write an ISPF dialog to do this, but would be limited to the maximum number of allowable steps in a job.

- 10,237
- 1
- 28
- 39
-
Hi, Thanks for your valuable answer. Sorry, But i dont know much about ISPF Dialog, Can you please guide me how can i learn more about this ? – GeekyGeek Mar 12 '14 at 08:04
I would consider looking at the REXX scripting language. You can simulate JCL pretty effectively by running one batch TSO step executing a REXX script.

- 1,422
- 10
- 21
-
Hi, Yes, my Seniors(Teammates) suggested me this only. But as I dont know REXX, trying to learn now.. :) Can you please guide how can i learn effectively ? – GeekyGeek Mar 12 '14 at 08:05
-
There are several good beginning REXX books available, plus many Internet sites. Personally I would do a Google search because everybody's learning style is different. – zarchasmpgmr Apr 01 '14 at 13:56
A number of sites have methods for submitting jobs from CICS. In addition if you have a scheduling team, products like Control-M will allow you to "generate" JCL with a variable number of steps or even multiple job cards that can then be "included" into a template member at submission time. They also allow for cyclic jobs that will check a token when run and by default be dummy jobs.

- 1,545
- 1
- 12
- 19