View previous topic :: View next topic
|
Author |
Message |
AADHAV KRISHNA
New User
Joined: 07 Aug 2012 Posts: 6 Location: India
|
|
|
|
Hello all,
consider a requirement as follows,
In a job, say there are two steps, in step1, a cobol program has been called which compares 2 files and generates a file only if there is some difference between the records.
step2, will check whether the generated file is empty or not, if it has some records, it restarts the job.
once the job is restarted and the step2 executes in same fashion except that it should abend the job instead of restarting.
so is there any way to capture whether the job has been restarted?
or else I have to create a step before step1, which allocates a PS file and writes a counter into it, by checking the counter in step 2, I can achieve the logic!!!!! |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Atleast I am not aware off
How do you restart the job from a step |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
In REXX you could do something like this :
execute cobol pgm
check if file empty
if not reexecute cobol pgm
check if file empty
if not terminate abnormally (abend or rc > 0) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The whole thing is a bit silly from what you have described. If the data remains the same, you'll get the same result the second time. So, what have you failed to mention...? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
AADHAV KRISHNA wrote: |
step2, will check whether the generated file is empty or not, if it has some records, it restarts the job.
once the job is restarted and the step2 executes in same fashion except that it should abend the job instead of restarting. |
What is this saying or asking, specially the bold-text? RESTART, in a JCL Forum, has a specifc meaning. I'm sorry but what does RESTART mean to you, in the context of your question and in JCL part of the Forum? |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
As Bill as said, the whole thing seems a bit odd. But would the simplest approach not be -
Step 1 - Cobol program
Step 2 - Compare - set return code if (not) different
Step 3 - Cobol program executes conditionally based on return code
Step 4 - Compare - abend job if different
rather than trying to restart the job and then apply some different logic on the second run. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10874 Location: italy
|
|
|
|
we all 'are missing' and I guess we all are anxiously waiting for the draconian/historical reply ...
that' s the requirement |
|
Back to top |
|
|
AADHAV KRISHNA
New User
Joined: 07 Aug 2012 Posts: 6 Location: India
|
|
|
|
Thanks all for responding!!!!! thanks david followed ur algorithm, it works!!!!!! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks for coming back and telling us what worked for you, appreciate it.
Good Luck! |
|
Back to top |
|
|
Dale Robertson
New User
Joined: 21 Jun 2013 Posts: 44 Location: U.S.A.
|
|
|
|
David Robinson,
Your approach is precisely what came to mind the moment I read the requirement.
r
Economics is what you already know made difficult.
--Wounded Eagle's Law |
|
Back to top |
|
|
|