IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamic JCL run by checking RC in $AVRS for prev run


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sushant Singh

New User


Joined: 27 Jul 2010
Posts: 3
Location: Pune

PostPosted: Thu Jul 29, 2010 12:40 pm
Reply with quote

Hi All,

I have a requirement to create a JCL, to copy some sequence of files into a fixed file with the condition of checking the Return code of preccessor job in successor job from $AVRS.

Sequence of files:
PROJ.SPLTFILE.F01
PROJ.SPLTFILE.F02
PROJ.SPLTFILE.F03
.....
.....
.....
PROJ.SPLTFILE.F99

Fixed File:
PROJ.CONV.OUTPUT

Here above fixed file is an auto trigger file job i.e. when we edit this file with some data, this file automatically trigger a job in production whose output can be verified in $AVRS spool.

Actually, if we consider it manually then we do a copy operation for above sequential files individually through a SORT job or IEBGENER. Then we check the RC for this job and auto trigger file job in $AVRS (both should be RC=0) before doing the copy operation for next sequential file. We need to automate this process since the amount of input sequential files are sometimes very large due to which we need to run the job many times.
I think of some solution using internal reader but couln't find much.

Kindly suggest some solution for this and let me know in case of any doubt.

Thanks,
Sushant
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1018
Location: India

PostPosted: Wed Aug 04, 2010 8:30 pm
Reply with quote

Hi Sushant,

Welcome to IBMMAINFRAMES,

Quote:
copy some sequence of files into a fixed file with the condition of checking the Return code of preccessor job in successor job from $AVRS.


We do this by setting up the scheduling criteria. So, the second job will not be executed until the first job finishes successfully.

Hope this helps,
Sushanth
Back to top
View user's profile Send private message
Sushant Singh

New User


Joined: 27 Jul 2010
Posts: 3
Location: Pune

PostPosted: Mon Aug 09, 2010 3:27 pm
Reply with quote

Hi Sushanth,

Thanks for replying. icon_smile.gif

Please note that first job is just a copy job in which the sequential files are getting copied into a fixed file which is an auto trigger file. This trigger file
triggers a job in production just after editing and the output of this trigger job is seen in $AVRS. The first job that is a copy job, runs in user/unit region (i.e. TSOA) not in production and second job i.e. auto trigger file job runs in production.
Now the query is that if we use scheduling criteria between these two jobs then how to put time lag between each steps of the first copy job. Because the second/successor step should be run after obtaining the output of the first/preccessor step production run in $AVRS. I mean the next step should be run only after verifying the output of first copy step run (i.e. the auto trigger file run) in production. Here, we have to set a condition in steps of user/unit region job to run depending on the corresponding production region job run return code.

Hope you get my points but please let me know in case of any concern.

Thanks & regards,
Sushant
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 10, 2010 12:47 am
Reply with quote

Hello,

Suggest the approach to this "requirement" be re-visited. . .

Knowing how the scheduling system works could save a lot of extra work and false starts. The scheduling people should be able to provide all of the informatoin needed.

You do not want to implement a process that can easily be disrupted and cause even more problems.

Quote:
I mean the next step should be run only after verifying the output of first copy step run (i.e. the auto trigger file run) in production.
What needs to be verified? If the job ends successfully, the process should continue. . . icon_confused.gif
Back to top
View user's profile Send private message
Sushant Singh

New User


Joined: 27 Jul 2010
Posts: 3
Location: Pune

PostPosted: Wed Aug 11, 2010 1:48 pm
Reply with quote

Hi Dick,

perhaps i couldn't articulate my requirement earlier. Below it goes -

I have 2 jobs - job 1 and job 2. Job 1 has say 10 steps and job 2 has only one step.I want job execution in following order -

job1 step1
job2
job1 step2
job2
job1 step3
job2
job1 step4
job2
...
...

i require this sequence because steps in job1 just copy different files into
a dataset, say triggerfile. whenever this triggerfile is edited, job2 gets triggered in production environment. so i want next step of job1 get started only when job2 is complete.

is there any way to check RC of job2 in job1 steps? or is there any other solution to this prob.?

Thanks,
Sushant
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 11, 2010 1:52 pm
Reply with quote

The two jobs can not interface in the way that you have described unless each job2 is a different name and you have batch pipes installed and running. But even that may not give you what you want.

If I were you, I would recreate job1 and include the step of job2 after each process of a step of job1.
Back to top
View user's profile Send private message
Liasar Rico

New User


Joined: 19 Aug 2010
Posts: 2
Location: Phoenix

PostPosted: Fri Aug 20, 2010 10:33 am
Reply with quote

Sushant -

To make your life easier, you can split Job1 steps into jobs (step3 to Job3, step4 to Job5...) and then make a scheduling change between the jobs. So in your Unit / user region, you will need to create dependency on those jobs. Job 1(originally step1) should be predecessor of Job2(originally step2), etc...

And aside from that, you also need to add a dataset trigger on those jobs which would be produced by the job you have in your production region which is Job2.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts $AVRS/SAVRS CICS 2
No new posts REXX - Dataset checking in a do forev... CLIST & REXX 6
No new posts Dynamic file allocation using JCL JCL & VSAM 8
No new posts Dynamic Sortin DD cards SYNCSORT 8
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
Search our Forums:

Back to Top