just plain SOP for developers, well, on a mainframe anyway. when you allocate a file, check the RC to make sure the allocation didn't fail before trying to read the file. then check your read before you try and process an input record. then check the record's length/words/datatype before trying to set variables... can save yourself a whole lot of head scratching trying to figure out why a whole program didn't work, much easier to debug when you know exactly what line of code failed.
what I usually do with my rexx programs is set one variable (maxcc =0) at the beginning, and then set every critical RC to lc, and then check "IF lc > maxcc THEN maxcc = lc". only if the RC indicates a critical failure do I use "SIGNAL The#end" to "EXIT maxcc". --- On Fri, 7/29/11, Paul Gilmartin <paulgboul...@aim.com> wrote: > From: Paul Gilmartin <paulgboul...@aim.com> > Subject: Re: REXX code on JES2 > To: IBM-MAIN@bama.ua.edu > Date: Friday, July 29, 2011, 3:52 PM > On Fri, 29 Jul 2011 10:56:58 -0700, > Cris Hernandez #9 <hernandez...@yahoo.com> > wrote: > > >but it changes constantly, > >got to take the snapshot to see it. > > > >--- On Fri, 7/29/11, Paul Gilmartin wrote: > > > >> On Thu, 28 Jul 2011 16:39:13 -0700, > >> Cris Hernandez #9 wrote: > >> > >> >lc = RC > >> > > >> >to capture the return code from all commands > & > >> calls (like ALLOC, EXECIO, FREE, etc.), then > code: > >> > > >> Why "capture" RC? It's not going to escape. > >> > >> >IF lc <> 0 THEN DO > >> > SAY 'Error performing xxxxxxxx. last RC =' > lc > >> > EXIT lc > >> >END > >> > > Huh!? You're EXITing What could possibly change > it? And if it > did, what difference would it make? Of course, if you > don't EXIT, > you know it was 0, and there's no need to have saved it. > > -- gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access > instructions, > send email to lists...@bama.ua.edu > with the message: GET IBM-MAIN INFO > Search the archives at http://bama.ua.edu/archives/ibm-main.html > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html