IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Abend deletes last record written


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
julietspringsteen

New User


Joined: 08 Aug 2020
Posts: 2
Location: United States

PostPosted: Fri Aug 21, 2020 7:45 pm
Reply with quote

I am working on an PL/I based application change and having an issue. I am changing an application not to abend every time it encounters a record-specific error, but instead to allow a pre-determined number of errors. If if hits that limit, it should still abend. Currently I am writing a record to a separate file keep track of each rejected record. However, the issue I am seeing is: when it does hit the limit, and abends, the last record from the rejects file is removed. I am trying to research it, but am not finding anything. Is there an abend-specific system process that would wipe the last record?
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Fri Aug 21, 2020 8:34 pm
Reply with quote

Read more details about I/O buffering.

Read about the difference between “logical records”, and “physical records”.
Back to top
View user's profile Send private message
julietspringsteen

New User


Joined: 08 Aug 2020
Posts: 2
Location: United States

PostPosted: Fri Aug 21, 2020 8:47 pm
Reply with quote

@sergeyken I am new mainframer (used to work on i Series), so still at a loss as where my best resources are. What are some of the best resources on I/O buffering?

Thanks!
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Fri Aug 21, 2020 9:49 pm
Reply with quote

julietspringsteen wrote:
@sergeyken I am new mainframer (used to work on i Series), so still at a loss as where my best resources are. What are some of the best resources on I/O buffering?

Thanks!

Please, do not expect a ready-to-use solution at this forum.

If you are “new main-framer” then you must start learning the basics from scratch, an probably, seek for help at the beginners forum.

Programming, especially for mainframes, is a thing seriously different from training yourself in a new computer game. Before starting “to program something” you may need to learn at least the fundamentals of computer science. Including “I/O buffering” which is approx. 0.001% of all these stuff.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 318
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Sat Aug 22, 2020 12:05 am
Reply with quote

Does the error dataset get CLOSED prior to ABEND?

How is the ABEND trapped and what happens next?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 865
Location: The Universe

PostPosted: Sat Aug 22, 2020 5:14 am
Reply with quote

I, too, have observed the problem the topic starter (TS) grumbles about. Sadly, after much thought, I have no really reliable way to resolve the problem.

The fundamental problem is how and when output data is committed to the data set. Since the TS reports he is using a high level language, we have nothing we can advise here as we have no direct knowledge about how the high level language (library, probably) works.

In Assembler programs, use QSAM "move" mode processing to commit the data to the data set as early as possible.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1226
Location: Vilnius, Lithuania

PostPosted: Sat Aug 22, 2020 9:26 am
Reply with quote

dneufarth wrote:
Does the error dataset get CLOSED prior to ABEND?

Rhetorical question? Having used PL/I for about 35 year, the rule is to close all files before issuing whatever you need to issue to get an abend. If you don't, the records that are still in the buffer will not be written out.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 865
Location: The Universe

PostPosted: Sat Aug 22, 2020 6:10 pm
Reply with quote

prino wrote:
dneufarth wrote:
Does the error dataset get CLOSED prior to ABEND?

Rhetorical question? Having used PL/I for about 35 year, the rule is to close all files before issuing whatever you need to issue to get an abend. If you don't, the records that are still in the buffer will not be written out.
This, too, is rather rhetorical, isn't it? By definition, most ABENDs are unexpected, so it is rather difficult to prepare for an ABEND in the sense that prino proposes. Worse, this "preparation" may, in fact, trigger an ABEND!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2432
Location: Hampshire, UK

PostPosted: Sat Aug 22, 2020 6:58 pm
Reply with quote

In this case the abend is delayed until n errors have been encountered so it is perfectly possible to close the dataset before giving in to the inevitable. However, it would be best to delay abending until ALL errors have been found. Then they can all be reported at once and all fixed together.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 865
Location: The Universe

PostPosted: Sat Aug 22, 2020 7:26 pm
Reply with quote

Nic Clouston wrote:
In this case the abend is delayed until n errors have been encountered so it is perfectly possible to close the dataset before giving in to the inevitable. However, it would be best to delay abending until ALL errors have been found. Then they can all be reported at once and all fixed together.
This leads to cascading ABENDs, which are just as bad and possibly worse. Going back to my days doing product support, I can recall several instances where there appeared to be multiple ABENDs in a problem, and it was difficult to deduce what the real problem was.

I agree with Mr. Clouston that one wants to fix all the problems, but it is not always possible especially when problem A kicks off problem B, which would not have happened if problem A had not happened.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1226
Location: Vilnius, Lithuania

PostPosted: Sat Aug 22, 2020 9:32 pm
Reply with quote

steve-myers wrote:
prino wrote:
dneufarth wrote:
Does the error dataset get CLOSED prior to ABEND?

Rhetorical question? Having used PL/I for about 35 year, the rule is to close all files before issuing whatever you need to issue to get an abend. If you don't, the records that are still in the buffer will not be written out.
This, too, is rather rhetorical, isn't it? By definition, most ABENDs are unexpected, so it is rather difficult to prepare for an ABEND in the sense that prino proposes. Worse, this "preparation" may, in fact, trigger an ABEND!

That's why you have the "error" on-unit in PL/I, which catches nearly everything, and allows you to close any files.
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 -> ABENDS & Debugging

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts ABEND=04E FOR REASON=00E50013 DB2 4
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Break a record into fields, each fiel... SYNCSORT 2
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8

Back to Top