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
 

 

EXTEND clause program got abended

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
nileshyp

New User


Joined: 22 Jun 2005
Posts: 65
Location: Mumbai

PostPosted: Fri May 27, 2011 2:37 pm    Post subject: EXTEND clause program got abended
Reply with quote

Hi,

I am facing an unusual problem. The sceanario is as follows:-

I have a input file with around 150 recs.
The output file is defined as OPEN EXTEND FILE-OUT

The program wrties the records to O/P after every 100 records commit point Or at the EOF condition.

The jcl declaration for the o/p file is as follows:-

Code:
//PCSFEEOP DD   DSN=TEST.TST.FEEOP,
//            UNIT=SYSDA,VOL=SER=TST001,         
//            DISP=(MOD),                         
//            SPACE=(CYL,(999,999),RLSE),       
//            DCB=(LRECL=500,RECFM=FB)


After ist run program got abended at 120th record and O/P file was written 100 recs onto it. When I resubmitted the job from the failed step it again failed at same (i.e. 120th) record and it still have 100 records.

I am not able to understand how o/p file has 100 recs only and why not 200 records when the dispostion is MOD and I am opening it in Extend mode in program. AS per my observation the dataset should be appended each time after running the same step.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri May 27, 2011 4:23 pm    Post subject:
Reply with quote

When you post the JCL (or pretty much anything) please use the CODE button, to put the code tags around your data. You have lost all your spacing. You have no comma after the DISP, so you have invalid JCL, which you have presumably typed, so you are not showing the actual JCL. Why not try to copy/paste it, then it saves you work and gets the information you are seeing into the forum as well.

Why would you want duplicate records? If you back-out everything, that should include your PCSFEEOP, if you don't back-out everything you shouldn't be doing the first 100 records again. I don't know about having EXTEND and MOD, I don't think you need both. Personally, I'd go with MOD. The JCL default for only specifying MOD would not delete your file in the case of an abend.

Where are you specifying your blocksize? If you have 100 records from your first run, yet your program abended without correctly closing the file, I'd not expect you to have 100 records, but for the last block (most of your file) to be missing. Is your blocksize 500? I think then you'd get 100 records, but you are doing a lot more actual IO than would be necessary if blocked reasonably.

We'd need more information for the particular problem. Did you look at the messages part of your output and see if there is anything there relating to the file?
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Tue May 31, 2011 7:59 pm    Post subject:
Reply with quote

Good day,

The reason that you are not appending the next 100 records is because you are missing the KEEP on the Disposition it should be DISP=(MOD,KEEP). IF you don't put the KEEP it will default to delete.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue May 31, 2011 8:05 pm    Post subject:
Reply with quote

Jose Mateo wrote:
Good day,

The reason that you are not appending the next 100 records is because you are missing the KEEP on the Disposition it should be DISP=(MOD,KEEP). IF you don't put the KEEP it will default to delete.

Wrong.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue May 31, 2011 8:06 pm    Post subject:
Reply with quote

Jose Mateo wrote:
Good day,

The reason that you are not appending the next 100 records is because you are missing the KEEP on the Disposition it should be DISP=(MOD,KEEP). IF you don't put the KEEP it will default to delete.

How would the TS know there are only 100 records if the dataset would have been deleted?
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: Tue May 31, 2011 8:25 pm    Post subject:
Reply with quote

Hello,

I'm having a long morning. . .

Quote:
If you omit the status subparameter, the default is NEW.
If you omit the normal termination disposition subparameter, the default is DELETE for a NEW data set or KEEP for an existing data set.
If you omit the abnormal termination disposition subparameter, the default is the disposition specified or implied by the second subparameter. However, if the second subparameter specified PASS, the default abnormal termination disposition is DELETE for a NEW data set or KEEP for an existing data set.
If you omit the DISP parameter, the default is a NEW data set with a disposition of DELETE for both normal and abnormal termination disposition. Thus, you can omit the DISP parameter for a data set that is created and deleted during a step.


Has it been confirmed whether the dataset exists or is being newly created?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue May 31, 2011 8:32 pm    Post subject: Reply to: EXTEND clause
Reply with quote

DISP=MOD, so exists. TS writing to it 100 records at a time. Job fails at 120 input record, TS finds 100 output records on dataset. TS runs job again, fails again, again finds 100 records on dataset. TS wonders why 100, not 200.

Curiously, despite the TS knowing the number of records on the file, Jose thought it might have been deleted.
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: Tue May 31, 2011 9:26 pm    Post subject:
Reply with quote

Hello,

Quote:
DISP=MOD, so exists. TS writing to it 100 records at a time.
As far as i know, disp=mod does NOT indicate the dataset exists. . .

MOD simply says when the file is opened, and it does not exist, then create it. If the file exists and is opened MOD, new writes are appended to the end of the file.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue May 31, 2011 11:22 pm    Post subject:
Reply with quote

The manual I linked to is a bit ambiguous as to whether the data set is deleted if it is new (i.e,, not pre-existing) or only if it is NEW (i.e., allocated with DISP=NEW). As Mr. Woodger says, however, the data set exists after the step is run.

At this point it is perhaps not inappropriate to ask that the TS provide some evidence that the step actually did abend; as we all know from sorry experience, "abend" is a term frequently misused by querents on this board.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jun 01, 2011 12:40 am    Post subject: Reply to: EXTEND clause
Reply with quote

The JCL snippet could be either, it looks like it was initially used to define the dataset, then edited down. Could now be MOD,DELETE,DELETE if the dataset doesn't exist, but then how to know how many records...

We need the TS back. He is telling us stuff, and not telling us stuff, so we can only speculate.

For instance, if he says there are 100 records on the dataset, maybe he's just looking at a record count in the dump, or a display after the records are written? I tried asking what his blocksize is, but no response. Unless the blocksize=lrecl I don't see how there would be 100 records on the dataset if the file hasn't been closed (because the current buffer would not have been written). If effectively unblocked, he'd see 100, otherwise fewer.

Perhaps he's just looking at counts, and Jose was right.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Wed Jun 01, 2011 12:48 am    Post subject:
Reply with quote

Hello,

Like Dick mentioned that the first time the default will be DISP=(NEW,DELETE,DELETE), in this case the disposition is DISP=(MOD). If the file doesn't exist it will create the file but if you don't put a termination disposition it will be deleted at normal or abnormal termination. When you run again the job it will try to create the file but if it doesn't have a termination disposition of KEEP it will be deleted again.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jun 01, 2011 12:53 am    Post subject:
Reply with quote

Got that bit Jose, thanks.

What was potentially gumming-up the works was the TS saying

Quote:

O/P file was written 100 recs onto it


Which kind of implies without enormous certainty that the dataset existed after the "abend".

It is certainly possible you got the answer right, Jose. Without the TS, we won't know.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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