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.
Abending the program if it satisfies a criteria
-
- 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
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.
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.
-
- 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
Hi,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.
Please share Your JCL to get better suggestions.
Anuj
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Abending the program if it satisfies a criteria
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.
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.
d.sch.
-
- 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
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.
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.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Abending the program if it satisfies a criteria
Hello,
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.
This suggestion will not provide the solution i believe the TS requested.As per what i got from ur question i can suggest u that
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.
d.sch.
-
- 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
There are other abend states such as 8 that maybe usefull
Re: Abending the program if it satisfies a criteria
Jeez, that is a return code, not an 'abend state'......t3chn0n3rd wrote:There are other abend states such as 8 that maybe usefull
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Abending the program if it satisfies a criteria
Hello,
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.
An 8 (or any other non-zero value) may be useful, but it is not an abend.There are other abend states such as 8 that maybe usefull
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.
d.sch.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Calling Java program on UNIX/USS from a COBOL CICS program?
by zbius » Tue Nov 05, 2024 2:37 pm » in IBM Cobol - 2
- 2595
-
by zbius
View the latest post
Wed Nov 06, 2024 6:02 pm
-
-
- 2
- 3163
-
by enrico-sorichetti
View the latest post
Mon Oct 30, 2023 6:25 pm
-
- 1
- 1672
-
by enrico-sorichetti
View the latest post
Sat Jun 12, 2021 12:18 pm
-
- 2
- 1072
-
by sergeyken
View the latest post
Fri Jul 14, 2023 7:13 pm
-
- 4
- 3088
-
by sergeyken
View the latest post
Mon May 22, 2023 12:52 am