Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Step1 will always give a zero return code even if it fails

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Step1 will always give a zero return code even if it fails
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 19, 2007 2:41 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 4:17 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 4:51 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 5:42 pm    Post subject:
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    Post subject:
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: 201
Location: USA

PostPosted: Wed May 09, 2007 8:09 pm    Post subject: Re: how to write this JCL,logic needed?
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us