Page 1 of 2

how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 6:12 am
by nishantsinghal
Hi Mainframes,

a jcl is having 5 steps. i have added a condition on step 5 ie cond=(7,GE,STEP2). Now i want step2 should return more than 7 so that step5 can execute.

And i can not make any changes in the cobol program.

Please share your thoughts.

Regards,
Nishant Singhal

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 6:42 am
by Robert Sample
Assuming, since you did not specify, that the COBOL program is executing in STEP2 you have several choices:
1) replace the COBOL program for testing with a utility that sets the return code to 8 or higher
2) change the COBOL program for testing to include MOVE 8 TO RETURN-CODE just before the program exits
3) put the change into production without testing
4) replace the COBOL program with a stub program for testing that just moves 8 to RETURN-CODE and exits

There may be other solutions but since you did not specify enough information to make clear what you want, and why, that's about all that can be said.

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 1:03 pm
by BillyBoyo
Presumably your Cobol program (if it is that) in the second step can, under some condition, provide a return-code greater than 7.

Presumably you are looking for ideas to test the JCL.

Why not run your program with test data which meets the criteria to produce a return-code greater than 7?

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 2:35 pm
by NicC
Or, for testing, replace the COBOL program with IDCAMS and provide SET MAXCC=whatever so that IDCAMS will set a return code of 'whatever'

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 10:30 pm
by nishantsinghal
Thanks all for your valuable suggestions....

bt i hv limited access to system.....actually i have made the changes in production JCL and i want to test that jcl before moving it to production.

I am not allow to touch the cobol code and and step 2 must have the same cobol program which is in prodution. Why, i want the same pgm at step2 because i hv to attach the job log of test run in my project management docs so that they can approve the same.

If you want the JCL for step2 then that i can provide you.

Please help me out to get it done.

Thanx

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 10:37 pm
by dick scherrer
Hello,

Create a test program with the same name as the "real" one (could be the same code and all with the addition of forcing the rc you want). Run your test and hang onto the JOB Log. Re-compile the real program and move on.

Re-reading your post, how do you intend to get the working process into production if you are not allowed to change the program of step 2? In other words, what will set the rc when step 5 is to be bypassed?

Hopefully you have misunderstood the "rules" or you need somone more qualified making assignments. . .

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 10:51 pm
by nishantsinghal
Dick,

actually step5 of a jcl is having a proc for sending email of abnormal termination.
Currently, step5 is executing either previous step executes successfully or not. So i have added a cond on step5 and
i want to test the jcl with my changes.

Again, i want to make it clear that i can not make any chnges in cobol pgm and i hv to use same loadlib of production in my test jcl.

is it clear or still having doubts. Plz let me know

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 10:59 pm
by dick scherrer
Hello,

I don't have any doubts. However, people in your organization have confusion. . .

You cannot do what you want without changing the program to set the new return code. If you continue to insist you want the program to work differently without changing it, you best get ready to manage the disappointment of whoever made such an assignment.

I have never seen a program start doing something new without the code being changed. Maybe someone in your organization can explain how they believe this might be accomplished (unchanged code doing something new).

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 11:03 pm
by BillyBoyo
I don't get it. Either the program can produce a non-zero RC or it can't.

If it can, make it so.

If it can't, then point that out to someone and get the "requirement" changed. Same program, same loadlibary, program can't get a RC of greater than 7, can't do this requirement.

Also, you are talking about two things. RC > 7 and "abnormal termination".

There is nothing "abnormal" about non-zero return-codes.

An "abnormal termination" is an abend, and the COND you have coded will not "catch" it, so no e-mail will b sent.

Re: how to abend step of a job intentionally????

PostPosted: Sun Sep 09, 2012 11:38 pm
by nishantsinghal
my question is as simple that is their any way to make it possibel by doing that changes in jcl only other thn loadlib and pgm on that step.

Abnormal termination is content of mail to notify the audiences for failure of job.