View previous topic :: View next topic
|
Author |
Message |
sureshmurali Warnings : 1 New User
Joined: 25 Nov 2010 Posts: 70 Location: Sivakasi, India
|
|
|
|
This is my job
Code: |
//STEP1 EXEC PGM=IEFBR14
//PERM1 DD DSN=XXXXXX.COBOL.PROG1.SAMP1,
// DISP=(NEW,CATLG,DELETE),
// LRECL=80,RECFM=FB
//*
//STEP2 EXEC PGM=FCOMMUO1
//TEMP2 DD DSN=&&TEMP2
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=* |
I called ILBOABN0 internally in the program FCOMMUO1 and made it to cause abend. I thought after job ends in abend, it will delete the dataset XXXXXX.COBOL.PROG1.SAMP1. But it still keeps it even after end up with abend and i could able to open the file too. Why it didnt delete the record after the job ended with abend although the disposition is given as DISP=(NEW,CATLG,DELETE), . Please clarify |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
The IEFBR14 (most likely) did not abend. . . . |
|
Back to top |
|
|
sureshmurali Warnings : 1 New User
Joined: 25 Nov 2010 Posts: 70 Location: Sivakasi, India
|
|
|
|
Thanks Dick,
But i called the routine ILBOABN0 inside the cobol program and its load is FCOMMUO1 and it caused SOC4 abend too. Then why it didnt delete the file after the abnormal termination of the job ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You need to study about how jcl works. . . The most basic understanding of the DISP parameter is needed - and as yet, you haven't been taught/learned the basics.
Once the IEFBR14 successfully ended, it does not matter what happens in the subsequent step. The system generates an abend, but this has nothing to do with some dataset that had been successfully created previously in the job. . . |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
sureshmurali wrote: |
I thought after job ends in abend, it will delete the dataset XXXXXX.COBOL.PROG1.SAMP1. |
You thought wrong. That's not how those parameters work.
Now, if you had done this:
Code: |
//*
//STEP2 EXEC PGM=FCOMMUO1
//TEMP2 DD DSN=&&TEMP2
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//PERM1 DD DSN=XXXXXX.COBOL.PROG1.SAMP1,
// DISP=(NEW,CATLG,DELETE),
// LRECL=80,RECFM=FB
|
then you'd have more success. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
You've two steps - 2nd step calls the "abend program", not the first one, in which you catalog the DSN-in-question. DISP for XXXXXX.COBOL.PROG1.SAMP1 in step1 is local to that step and the system did exactly what you said it to - step1 was executed normally so the 2nd-argument (CATLG) of DISP was honored for that step, as others has said. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
It appears that you are not using the allocated dataset in your FCOMMUO1 job step.
If you moved your allocation step after the application program step, the step will not be executed (will be flushed) at an abend given normal COND code processing, so you didn't even have to code the ,DELETE disposition.
If you intend to use the allocated dataset in the FCOMMUO1 program, you could code DISP=(OLD,DELETE). Then the dataset would be deleted if an abend occurs in your application. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
Quote: |
If you intend to use the allocated dataset in the FCOMMUO1 program, you could code DISP=(OLD,DELETE). Then the dataset would be deleted if an abend occurs in your application.
|
DISP=(OLD,DELETE) would delete the dataset for any return code or abend code.
DISP=(OLD,KEEP,DELETE) might be more appropriate if you intend to delete the datset on abends only.
Gerry
Gerry |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
gcicchet wrote: |
DISP=(OLD,KEEP,DELETE) might be more appropriate if you intend to delete the datset on abends only.
|
Indeed, thanks |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
Think about how nice it is that in a very long job, when a later step abends, datasets created earlier are still there.
That means that the job can be restarted at or anywhere before the abending step, thereby saving all the time not having to rerun the job from the start.
This is a feature, not a problem, But one must handle it right, as the above posters have addressed. |
|
Back to top |
|
|
|