IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File not deleted after abnormal termination


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sureshmurali
Warnings : 1

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Fri Mar 04, 2011 9:36 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 04, 2011 9:44 pm
Reply with quote

Hello,

The IEFBR14 (most likely) did not abend. . . .
Back to top
View user's profile Send private message
sureshmurali
Warnings : 1

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Fri Mar 04, 2011 9:53 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 04, 2011 9:59 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Mar 04, 2011 10:01 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 04, 2011 10:15 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Sat Mar 05, 2011 1:11 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sat Mar 05, 2011 4:25 am
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Sat Mar 05, 2011 9:43 pm
Reply with quote

gcicchet wrote:
DISP=(OLD,KEEP,DELETE) might be more appropriate if you intend to delete the datset on abends only.

Indeed, thanks icon_exclaim.gif
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Sun Mar 06, 2011 12:32 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top