View previous topic :: View next topic
|
Author |
Message |
julietspringsteen
New User
Joined: 08 Aug 2020 Posts: 2 Location: United States
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
Read more details about I/O buffering.
Read about the difference between “logical records”, and “physical records”. |
|
Back to top |
|
|
julietspringsteen
New User
Joined: 08 Aug 2020 Posts: 2 Location: United States
|
|
|
|
@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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
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 |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Does the error dataset get CLOSED prior to ABEND?
How is the ABEND trapped and what happens next? |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1312 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1312 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
|