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


  • Subject: Re: finding whether file exists or already opened
  • From: rob@xxxxxxxxx
  • Date: Thu, 21 Jun 2001 16:30:56 -0500


Check %status.
See page 77 of the ILE RPG reference, which is page 97 of the manual at:
http://publib.boulder.ibm.com/html/as400/v5r1/ic2924/books/c0925083.pdf
Code    Device 1 RC 2 Condition
01215   all      n/a  OPEN issued to a file already opened.
01216 3 all      yes  Error on an implicit OPEN/CLOSE operation.
01217 3 all      yes  Error on an explicit OPEN/CLOSE operation.
3. Any errors that occur during an open or close operation will result in a
*STATUS value of 1216 or 1217
regardless of the major/minor return code value.

(I don't think major/minors apply to disk files.)

Maybe the File Information Data Structure may help:
Table 5. Contents of the File Feedback Information Available in the File
Information Data Structure
(INFDS) (continued)
From   To
(Pos.  (Pos.
26-32) 33-39) Format    Length    Keyword    Information
46     52     Character 7                    Machine or system message
number.

See page 66 of the same manual, which is pdf page 86.

Rob Berendt

==================
A smart person learns from their mistakes,
but a wise person learns from OTHER peoples mistakes.


                                                                                
                                       
                    James David Rich                                            
                                       
                    <james@eaerich.co        To:     <RPG400-L@midrange.com>    
                                       
                    m>                       cc:                                
                                       
                    Sent by:                 Subject:     finding whether file 
exists or already opened                
                    owner-rpg400-l@mi                                           
                                       
                    drange.com                                                  
                                       
                                                                                
                                       
                                                                                
                                       
                    06/21/2001 02:32                                            
                                       
                    PM                                                          
                                       
                    Please respond to                                           
                                       
                    RPG400-L                                                    
                                       
                                                                                
                                       
                                                                                
                                       




I need to know if a file does not exist or is already open when using the
'open' opcode.  But there are not separate indicators for 'does not exist'
and 'already open'.  Can %error be used?  If so, how?

James Rich
james@eaerich.com

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---




+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 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.