× 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.



As a baby step (for our shop) into the world of service programs, I am 
attempting to externalize
what are now several subroutines into external procedures.

The function serves to trap and handle file I/O errors such as RNX1211 "I/O 
operation was applied
to closed file CUSTMAST."  I was hoping that we could capture the filename in 
the Program Status
Data Structure, but the filename is not found in any fixed location.  Yes, it 
is in the error
message that appears in the PSDS, but the filename itself can't be counted on 
to be in any fixed
location.  

The RPG reference indicates that positions 175 - 184 represent "Name of file on 
which the last
file operation occurred (updated only when an error occurs). This information 
always contains the
full file name."  This is the same for both v4r5 & v5r2.  The implication seems 
to be that when a
file error occurs, that filename will be placed in that PSDS subfield.  
However, I wonder if
"successfully" should be inserted between "operation" & "occurred", because 
this area (subfield
SDSFILERR) is always blank in my testing of: 

  FCustMast  IF   E           K DISK    usropn
  DSDSDS           SDS          2048          
  D SDSPGMNAM         *PROC                   
  D SDSSTATUS         *STATUS                 
  D SDSERRMSG              91    170          
  D SDSFILERR             175    184          
  D ZBIGENCHILADA           1   2048
  C   LR              Open      CustMast
  C                   READ      CustMast
  C                   eval      *inLR = *on

(Note that this is not an example of our shop's code; it is just to test this 
issue.)

Have I uncovered a bug in the compiler?  Or have I misinterpreted the 
definition in the reference?

So, our current workaround is to do a "WHEN %STATUS(filename) > *ZERO" test for 
each and every
file defined in the program.  Which makes it impossible to turn this routine 
into a service
program.

Advice would be appreciated.

- Dan

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.