When I mentioned an empty-dataset condition, of course I was thinking of situations in which an empty dataset is an error condition, in which case I want to generate an error message where the operator can't miss it. Otherwise it doesn't matter -- that is, it matters that the code handle it correctly, but it doesn't have to stop the program.
What you describe here reminds me of a function I use in many Excel programs to determine the last data row in a worksheet. I use it routinely, so it has to work even in odd circumstances such as no rows, one row, no header, multiple header rows and so on. That means the LastRow function checks for a lot more conditions than ~most~ cases call for -- but I don’t want to stop and think about each particular case. Once it works, I can toss it in without thinking much about it. I guess that's kind of what you're saying below. --- Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313 /* Applying computer technology is simply a matter of finding the right wrench to pound in the correct screw. */ -----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Paul Gilmartin Sent: Tuesday, June 15, 2021 20:17 Rather, I consider that a routine boundary condition, to be handled by extrapolation. For example, Linkage Editor accepted empty SYSLIN, did nothing, and exited with RC=0. Some of my scripts depended on that orderly beehavior. Binder, given empty SYSLIN attempts to create an invalid program object and terminates with severe error status. I needed to add code to those scripts to bypass the link edit step when SYSLIN is empty. I don't consider the performance gain worth even the minimal added complexity. I once dealt with a (bubble) sort routine coded by a co-worker that program checked on single-record input. A check for that should be the responsibility of the function, not the caller. Usually no such explicit check is necessary if loop termination condition is chosen correctly. --- On Tue, 15 Jun 2021 18:06:53 -0400, Bob Bridges wrote: >3) ... I include checks for file-not-found, empty datasets... ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN