On Error System
wan to return to the place the error occured and abend with the original error. This way I would be able to do some put skips and still have the trace in the dump. Is that possible ? Brgds Jesper Thu, 06 Nov 2003 19:19:14 GMT Daniel Jaco#2 / 6 ON ERROR ON ERROR BEGIN; DCL PLIDUMP BUILTIN; PUT SKIP LIST(A); PUT SKIP LIST(B); ON ERROR SNAP SYSTEM; CALL PLIDUMP('TFCHB'); END; Works fine as long as the variables (A and B in this sample) are not the cause of the failure. If 'A' is declared as DEC FIXED and contains a non packed value, B is not printed anymore since a data exception occurs in the 'PUT' statement. Why would http://www.ibm.com/support/knowledgecenter/SSY2V3_3.9.0/com.ibm.entpli.doc_3.9/mg/ibmm2mst105.htm you want to return to the place the error occured? Leave an 'ON ERROR' clause is permitted with a GOTO, so it is not easy to return back to where the error occured. Jesper Pedersen stated... Quote:>I would like to code an ON ERROR block that do som kind of logging of the >error and the current value of the varaiabes.After that I wan to return to >the place the error occured and abend with the original error. >This way I would be able to do some put skips and still have the http://computer-programming-forum.com/34-pl1/6224ec73929379c5.htm trace in >the dump. Is that possible ? >Brgds Jesper ------------------------------------------------- With kind regards Daniel Jacot ------------------------------------------------- visit us at: http://www.winterthur.com Sat, 08 Nov 2003 16:03:44 GMT Jesper Pederse#3 / 6 ON ERROR Sorry - maybe I didn't explain my problem clearly. I would like to return the place the error occured so i get the Trace in my dump AND the put skips in the on-error block - resulting for example in: in SYSPRINT: "FROM ON ERROR, A = xxxxxxx" "FROM ON ERROR, B = yyyyyyy" so on And in the dump (something like) MAIN CALLED PROCEDURE AAA IN offset statement AAA CALLED BBBB in offset statement BBBB CALLED CCC in offset statement 0C7 occured in procedure CCC in offset statement Currently I either get the dump or the sysprint depending on I code an ON-ERROR block or not... (I don't quite understand what your saying about the ON ERROR equals GOTO ? (maybe I misunderstand you, but my english is not so good). Brgds. Quote:> ON ERROR BEGIN; > DCL PLIDUMP BUILTIN; > PUT SKIP LIST(A); > PUT SKIP LIST(B); > ON ERROR SNAP SYSTEM; > CALL PLIDUMP('TFCHB'); > END; > Works fine as long as the variables (A and B in this sample) are not the cause > of the failure. If 'A' is declared as DEC FIXED and contains a non packed value, > B is not printed anymore since a data exception occurs in the 'PUT' statement. > Why would you want to return to the place the error occured? Leave an 'ON ERROR' > clause is permitted with a GOTO, so it is not easy
citations to reliable sources. Unsourced material may be challenged and removed. (August 2008) (Learn how and when to remove this template message) In information theory and coding theory with applications https://en.wikipedia.org/wiki/Error_detection_and_correction in computer science and telecommunication, error detection and correction or error control are techniques that enable reliable delivery of digital data over unreliable communication channels. Many communication channels are subject to channel http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html noise, and thus errors may be introduced during transmission from the source to a receiver. Error detection techniques allow detecting such errors, while error correction enables reconstruction of the original data in on error many cases. Contents 1 Definitions 2 History 3 Introduction 4 Implementation 5 Error detection schemes 5.1 Repetition codes 5.2 Parity bits 5.3 Checksums 5.4 Cyclic redundancy checks (CRCs) 5.5 Cryptographic hash functions 5.6 Error-correcting codes 6 Error correction 6.1 Automatic repeat request (ARQ) 6.2 Error-correcting code 6.3 Hybrid schemes 7 Applications 7.1 Internet 7.2 Deep-space telecommunications 7.3 Satellite broadcasting (DVB) 7.4 Data storage on error system 7.5 Error-correcting memory 8 See also 9 References 10 Further reading 11 External links Definitions[edit] The general definitions of the terms are as follows: Error detection is the detection of errors caused by noise or other impairments during transmission from the transmitter to the receiver. Error correction is the detection of errors and reconstruction of the original, error-free data. History[edit] The modern development of error-correcting codes in 1947 is due to Richard W. Hamming.[1] A description of Hamming's code appeared in Claude Shannon's A Mathematical Theory of Communication[2] and was quickly generalized by Marcel J. E. Golay.[3] Introduction[edit] The general idea for achieving error detection and correction is to add some redundancy (i.e., some extra data) to a message, which receivers can use to check consistency of the delivered message, and to recover data determined to be corrupted. Error-detection and correction schemes can be either systematic or non-systematic: In a systematic scheme, the transmitter sends the original data, and attaches a fixed number of check bits (or parity data), which are derived from the data bits by some deterministic algorithm. If only error detection is required, a receiver ca
but is more flexible. In fact, its flexibility extends beyond error handling--conditions are more general than exceptions in that a condition can represent any occurrence during a program's execution that may be of interest to code at different levels on the call stack. For example, in the section "Other Uses for Conditions," you'll see that conditions can be used to emit warnings without disrupting execution of the code that emits the warning while allowing code higher on the call stack to control whether the warning message is printed. For the time being, however, I'll focus on error handling.The condition system is more flexible than exception systems because instead of providing a two-part division between the code that signals an error1 and the code that handles it,2 the condition system splits the responsibilities into three parts--signaling a condition, handling it, and restarting. In this chapter, I'll describe how you could use conditions in part of a hypothetical application for analyzing log files. You'll see how you could use the condition system to allow a low-level function to detect a problem while parsing a log file and signal an error, to allow mid-level code to provide several possible ways of recovering from such an error, and to allow code at the highest level of the application to define a policy for choosing which recovery strategy to use.To start, I'll introduce some terminology: errors, as I'll use the term, are the consequences of Murphy's law. If something can go wrong, it will: a file that your program needs to read will be missing, a disk that you need to write to will be full, the server you're talking to will crash, or the network will go down. If any of these things happen, it may stop a piece of code from doing what you want. But there's no bug; there's no place in the code that you can fix to make the nonexistent file exist or the disk not be full. However, if the rest of the program is depending on the actions that were going to be taken, then you'd better deal with the error somehow or you will have introduced a bug. So, errors aren't caused by bugs, but neglecting to handle an error is almost certainly a bug.S