Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File not deleted after abnormal termination

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: File not deleted after abnormal termination
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

Site Director


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

PostPosted: Fri Mar 04, 2011 9:44 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Mar 04, 2011 9:59 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Mar 04, 2011 10:01 pm    Post subject: Re: File not deleted after abnormal termination
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

Senior Member


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

PostPosted: Fri Mar 04, 2011 10:15 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Sat Mar 05, 2011 4:25 am    Post subject:
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    Post subject:
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

Active Member


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

PostPosted: Sun Mar 06, 2011 12:32 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us