× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Oliver,

You wrote:
>one more question (or two). If I want to catch all file errors, I'll have 
>to code INFSR for each and every file? Or is there a possibility to declare 
>this for all files?

You have to code the INFSR for each file for which you want to catch errors. 
*PSSR is global for program errors but there is no global file error handler.

>We have 20+ (sometimes 60-80) files in some programs, and that would be 
>lots of work.

Write a program to insert the code for you. It would read the program source, 
locate the F-spec containing a file name, and add a new line containing:
        C                                               KINFSR*PSSR

or for RPG IV:
        C                                                       INFSR(*PSSR)

>Generally, it would be enough for us if we could force a dump on each 
>error and send a message somewhere. There are only very few situations where I 
>can continue the crashed program.

When INFSR routines or the *PSSR are invoked as a result of an unexpected error 
they are reached by a jump or branch or GOTO generated by the compiler. That 
means you have no way of knowing how you reached the error handler and 
therefore 
no way of knowing where you should return. Sometimes it is possible to continue 
at *GETIN or branch to a known point in the program such as the start of the 
main loop but mostly an error handler should just exit after collecting 
diagnostic information.

The problem is not so much the use of GOTO but rather the lack of a COMEFROM.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists       
                                                                  
   http://www.flybynight.com.au/                                  
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   
   Fax:   +61 3 9419 0175   mailto: shc@xxxxxxxxxxxxxxxxx   \ /   
                                                             X    
                 ASCII Ribbon campaign against HTML E-Mail  / \   
--------------------------------------------------------------------


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.