|
On Thursday, September 17, 1998 12:46 PM, Leland, David [SMTP:dleland@Harter.com] wrote: > I've been thinking about adding a *PSSR subroutine as a work-around. > How do I then return to the line directly after the line that the error > happened on? The hole gets deeper... You can't directly GOTO the line after the error occurred. Basically, you'll need to set a flag to indicate where you are, then your *PSSR does an ENDSR *DETC. Now that you're at the top of the detail calcs, you check your flag and GOTO the spot after the error, something like this, perhaps: H DEBUG F* Test date on display file FTstDatFM CF E Workstn * If an error was trapped by the *PSSR, WhereAmI will be populated * with the last known "good" position, so we need to return there. C Select C When WhereAmI='GetChg' C GoTo ChgFailed C When WhereAmI='GetCh2' C GoTo Ch2Failed C EndSl * Housekeeping C Movel *Blanks WhereAmI 6 C Z-add 0 pgmstat 5 0 * Show the first screen * If a date is bad on the screen because of CA03, all we really want to do is * go on with life. The *PSSR will get control, return to *DETC and the first * lines of code will send me to the line following the EXFMT C Move *DATE ProMasDatW C Movel 'GetChg' WhereAmI C Exfmt CHG * Show the next screen * If a date is bad on the screen because of CA03, all we really want to do is * go on with life. The *PSSR will get control, return to *DETC and the first * lines of code will send me to the line following the EXFMT C ChgFailed Tag C Move *DATE ProMasDatW C Movel 'GetCh2' WhereAmI C Exfmt CHG C Ch2Failed Tag C SetOn LR * If we get any program errors, like divide by zero or invalid date, * control will come here C *PSSR BEGSR C Eval PgmStat=%Status * If we have a date error, return to the top of the calcs C If PgmStat=00112 C Movel '*DETC ' Action 6 C Else * all other errors are fatal. Kill the program so the caller will know * we did an abend. C Dump C Movel '*CANCL' Action C EndIf C ENDSR Action It's ugly. Buck Calabro Commsoft, Albany, NY mailto:mcalabro@commsoft.net +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.