I am running a query through jcl to pull data from table.
Query has three parts part 1, part 2 and part 3.
I have to run the same query for n number of times lets say for 1000 records it needs to be run 10 times.
Now I want to use only 1 step in the job and change the part 2 of the query to create 10 different steps dynamically and submit them under one job.
All of this using REXX.
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
If you are asking whether you can submit job A that uses REXX to generate 10 different steps in job A, then the answer is that what you want to do cannot be done -- period. Once a job is submitted and passes through the converter / interpreter of JES, it cannot be changed -- period.
If you want job A to generate job B with 10 steps and submit it through the internal reader to the system, then this can be done -- and has been explained on this forum MANY times; use the Search function.
If you want something else, you will need to explain what you are attempting to do.
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
15 digit number? What you have shown are 3 11-digit numbers with no context in which to place them! Sample input and sample output might help us to understand.
So you are talking about a foreground execution generating a ten step job and then submitting it?
SELECT A.ABS_bnv
,B.ABS_bnv
FROM PROD.AAA_BBB_CCC A
,PROD.ZZZ_XXX_NNN B
WHERE
AND A.ABC_ID IN
( '00014546589',
'00014565832',
'00067018564' )
AND A.XYZ = B.XYZ
AND A.HJH = B.HJH
Part 2 contains only
'00014546589',
'00014565832',
'00067018564'
Rest of the query is static.
1st half is part1 and second half is part 3.
Yes I want to generate 10 steps under one job with varying part2 and then submit this job.
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
Piece of pie. Create a skeleton with suitable items (job name, step name and library and member containing keys to be searched for ought to be enough, I trow) as variables; include everything but the job card in a )DOT construct. Create a Rexx script that reads the list of libraries and members, and adds them with a fabricated step name (the literal "STEP" concatenated with record counter should be sufficient) to an ISPF table. Tailor the skeleton and submit the resulting job.
Thank you, Pandora-Box, for sharing the sample code. I learnt ISPF table and )DOT concepts from your example. Yet to explore more to make use of this concept in my code. link to my post