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

Step1 will always give a zero return code even if it fails


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

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Thu Apr 19, 2007 2:35 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 19, 2007 2:41 pm
Reply with quote

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
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Thu Apr 19, 2007 2:45 pm
Reply with quote

^^ 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 icon_lol.gif mayb gone mad icon_lol.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 4:17 pm
Reply with quote

Would not this be simple for rc checking on each step?
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Thu Apr 19, 2007 4:35 pm
Reply with quote

^^ yes i was also doin the same but step1 is giving RC 0 even if report says processing didnt went fine
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 4:51 pm
Reply with quote

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
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Thu Apr 19, 2007 5:32 pm
Reply with quote

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 icon_lol.gif icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 5:42 pm
Reply with quote

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
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Thu Apr 19, 2007 5:59 pm
Reply with quote

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
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Wed May 09, 2007 8:09 pm
Reply with quote

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 icon_smile.gif
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top