Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.misty.com!news.iecc.com!.POSTED!nerds-end From: "Robin Vowels" Newsgroups: comp.compilers Subject: Re: PL/I exceptions Date: Sun, 30 Mar 2014 01:58:11 +1100 Organization: Compilers Central Lines: 52 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-085@comp.compilers> References: <14-03-065@comp.compilers> <14-03-068@comp.compilers> <14-03-070@comp.compilers> <14-03-076@comp.compilers> <14-03-079@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1396115982 25672 2001:470:1f07:1126:0:676f:7373:6970 (29 Mar 2014 17:59:42 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 29 Mar 2014 17:59:42 +0000 (UTC) Keywords: history, PL/I Posted-Date: 29 Mar 2014 13:59:41 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1207 From: "glen herrmannsfeldt" > One I remember, but maybe no-one does anymore. You can use ON ENDPAGE > to paginate output. When an attempt is made to print a line past the > end of the page (an attribute of printable output files) the ENDPAGE > ON unit is executed, which skips to the next page It actually doesn't do that. In the absence of an ON-unit, the standard system action is to start a new page. With an ON-unit activated, PL/I does not "skip[] to a new page". The code in the ON-unit may print a footer for the current page. The code in the ON-unit must then execute PUT PAGE explicitly (or a PAGE option) to start the new page, where a header (incorporating an automatically-generated page number via PAGENO) can be printed. When the ON-unit concludes, normal printing continues. > and prints any page > headers. Then return and let the output continue. > > ENDFILE, on the other hand, (on input files) most likely goes on to > process the data. It might be that you could close the file, open a > new one and continue on. I never tried that. Yes, you can do that, or even re-read the same file. > For CONVERSION, you can test the invalid character, and, if desired, > replace it with a different one. Or you can examine the entire field, and replace some or all of the entire field. You probably also want to print the bad field. > For SUBSCRIPTRANGE and STRINGRANGE there likely isn't much to do, > maybe just print a message. You could go process something else, but > usually not much point in trying again. What is normally done for SUBSCRIPTRANGE is to include in the ON-unit some PUT statements that print the values of variables that are used for subscripts, and possibly some other variables, so that you don't have to re-run the program to ask the same questions again. With STRINGRANGE, it's usual to continue execution, because after displaying an error message, PL/I forces the SUBSTRing arguments so as to confirm to the rules (i.e., so that nothing is out-of-range, and nothing can be damaged). It would also be usual to include a print statement in the ON-unit to print values of variables used in SUBSTRing references. STRINGSIZE warns you that the destination of an assignment etc is shorter than the characters or bits assigned to it. For serious errors, the ERROR condition also is raised following the raising of the relevant condition (e.g., SUBSTRIPTRANGE, OVERFLOW, etc).