Abending the program if it satisfies a criteria

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
karthick
Posts: 6
Joined: Thu Oct 11, 2007 12:16 pm
Skillset: Cobol JCL DB2 IMSDB
Referer: Google search

Abending the program if it satisfies a criteria

Postby karthick » Wed Jan 09, 2008 10:35 am

Hi All,
Im developing a Cobol Program, such that if a criteria matches i have to abend the program. So that all my files that are created during the process needs to be deleted. But though the criteria matches im getting maxcc = 12 and the files are not getting deleted. i have tried with Disp = (shr) and (old,catlg,delete) in the Jcl. Can some one help me on this please.

karthick.

arunprasad.k
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Skillset: Known little stuffs to answer a few queries!!
Referer: Google
Contact:

Re: Reg a

Postby arunprasad.k » Wed Jan 09, 2008 2:35 pm

karthick,

Here are some of my instructions.

#1 If you want to abend the program use some of the application defined utility to abend the program (check the existing production program) with DISP=(NEW,CATLG,DELETE) to delete the O/P files.

#2 If you want the program to end with return code 12, then add the statement in your COBOL program 'MOVE 12 TO RETURN-CODE' and have a IEFBR14 step with COND parameter and delete the files (using DISP=(OLD,DELETE,DELETE)

Arun.

Anuj Dhawan
Posts: 272
Joined: Mon Feb 25, 2008 3:53 am
Skillset: None
Referer: Google
Location: Mumbai, India

Re: Abending the program if it satisfies a criteria

Postby Anuj Dhawan » Tue Feb 26, 2008 10:05 am

karthick wrote: But though the criteria matches im getting maxcc = 12 and the files are not getting deleted. i have tried with Disp = (shr) and (old,catlg,delete) in the Jcl. Can some one help me on this please.
Hi,

Please share Your JCL to get better suggestions.
Anuj

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

Re: Abending the program if it satisfies a criteria

Postby dick scherrer » Tue Feb 26, 2008 10:50 pm

Hello,

You need to change the program to force an abend rather than a "maxcc=12". A maxcc=12 is not an abend.

If your jcl specifies (NEW,CATLG,DELETE), you will get the desired result once you cause the program to actually abend. One way to force an abend is to cause a divide by 0 which will result in an s0cb abend (not a maxcc). As this is most ungraceful, systems usually have an invokable user-abend module that will allow programs to abend with a Unnnn abend code.
Hope this helps,
d.sch.

rawatdewan
Posts: 14
Joined: Tue Jan 15, 2008 5:28 pm
Skillset: cobol,jcl,db2
Referer: internet

Re: Abending the program if it satisfies a criteria

Postby rawatdewan » Fri Feb 29, 2008 12:44 pm

As per what i got from ur question i can suggest u that

in cobol use
if (condition to be tested)
(set maxcc = 12)
move 12 to returncode.
else
other processing


in jcl (using if else)

check for the maxcc
if it satisfy
delete the files using
disp = (mod,del,del)
otherwise
do other processing.

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

Re: Abending the program if it satisfies a criteria

Postby dick scherrer » Fri Feb 29, 2008 10:36 pm

Hello,

As per what i got from ur question i can suggest u that
This suggestion will not provide the solution i believe the TS requested.

The original request was to force an abend when some conditon happens. A User Abend is a much better way to go than setting a return code and testing via additional jcl.
Hope this helps,
d.sch.

t3chn0n3rd
Posts: 9
Joined: Sat Feb 16, 2008 10:37 pm
Skillset: jcl, cobol, db2
Referer: google

Re: Abending the program if it satisfies a criteria

Postby t3chn0n3rd » Sun Mar 02, 2008 7:38 pm

There are other abend states such as 8 that maybe usefull

CICS Guy
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am

Re: Abending the program if it satisfies a criteria

Postby CICS Guy » Sun Mar 02, 2008 9:59 pm

t3chn0n3rd wrote:There are other abend states such as 8 that maybe usefull
Jeez, that is a return code, not an 'abend state'......

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

Re: Abending the program if it satisfies a criteria

Postby dick scherrer » Sun Mar 02, 2008 10:42 pm

Hello,

There are other abend states such as 8 that maybe usefull
An 8 (or any other non-zero value) may be useful, but it is not an abend.

People need to understand that calling an rc=8 or a maxcc=12 an abend does not make it an abend. Abends have a very specific definition on the mainframe and only true abends should be called an abend. Batch abends will be Unnnn or Sxxx.
Hope this helps,
d.sch.


  • Similar Topics
    Replies
    Views
    Last post