View previous topic :: View next topic
|
Author |
Message |
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
i have a JCl as follows:
//step1 execute a pgm (it generates a report,telling whether processing went fine or not)
//step2
//step3
//step4
//step5
my requirement is that if step1 generates a report that processing went fine ...then step 2 & 4 shud execute
if step1 generates a report that processing didnt went fine ....then step 3,4&5 shud execute
just for ur info, step1 will always give a zero return code whether processing went fine or not as it is generating a report only..
how can i achieve this |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
just for ur info, step1 will always give a zero return code whether processing went fine or not as it is generating a report only.. |
That sounds like real bad programming to me.
So you will need to write another program or use a utility to read the output from step1 and do what is needed from that step. Of course if it was programmed correctly in the first place you would not have to do this. |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
^^ yes ur absolutely right,, i dont know why they coded like this
FYI ...this pgm was coded in 1986...so i dont know wat the coder was upto mayb gone mad |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Would not this be simple for rc checking on each step? |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
^^ yes i was also doin the same but step1 is giving RC 0 even if report says processing didnt went fine |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
paul_007 wrote: |
^^ yes i was also doin the same but step1 is giving RC 0 even if report says processing didnt went fine |
So how do you expect a decision to be made about whether the report says good or bad?
I suppose you could read the report in step1.5 and then set the rc.
A more intelligent solution for your requirement would be to alter the report program.
A good alternative would be to hire somebody to read the report and submit the needed steps. |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
Quote: |
So how do you expect a decision to be made about whether the report says good or bad?
I suppose you could read the report in step1.5 and then set the rc.
A more intelligent solution for your requirement would be to alter the report program.
A good alternative would be to hire somebody to read the report and submit the needed steps. |
i can open the report from step 1 and frm thr i can tell whether processing went fine or not
i think reading the report is not feasible as it has no fixed structure, it is just like a "story" and hence i cant write a record layout for it
ur second solution is wat i am goin to follow, i will alter the pgm which is generating this report and move some different value to return-code if processing dont go fine
your last solution is excellant but i can do it cause iam myself hired for this job |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
paul_007 wrote: |
i can open the report from step 1 and frm thr i can tell whether processing went fine or not
i think reading the report is not feasible as it has no fixed structure, it is just like a "story" and hence i cant write a record layout for it |
It may not have a easily producible "record layout" but there may be specific phrases in certain places in the report that can be scanned for..... |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
Quote: |
It may not have a easily producible "record layout" but there may be specific phrases in certain places in the report that can be scanned for..... |
actually the report is havin 150 lines and only in 148th line it is indicating that processing didnt went fine and all the 150 lines are different. |
|
Back to top |
|
|
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 216 Location: USA
|
|
|
|
Hi
I can give my idea. Please let me if it works or not.
steps:
1. Add a para which will have some code like opening the report in the input mode and read 148 line (which will specify the error info), That you can do by adding a line counter as cobol reads a record at a time. once the counter reaches 148 , then here add an if condition to check whether that line is having the error indication(for this you need modify the report logic so that it will move first or some character as "E" for an error or "s" for success).
2. Then call an abend para in the if condition if it encounters "e".
3.so the step1 will abend for the error report.
4.In the JCL don't code COND parameter for step4.(As it is executing for any case)
5.Code //step2 exec pgm,cond=only
//step3 exec pgm,step1.cond=(0,EQ)
//step5 exec pgm,step1.cond=(0,EQ)
This is my idea about your problem.
Please let me now if my understanding is wrong.
Ofcourse the thing I have told above to do is difficult to implement. But I feel this would be the convinient way to do it.
Regards
Amar |
|
Back to top |
|
|
|