Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Is there a way to prevent this message from displaying on the screen from an RPG ILE pgm?
Open options ignored for shared open of member File Format name.
It scares our users!
If you pre-open the file in another program or perhaps even in CL (using the OPNDBF command) you can avoid it. Specify the OPTION(*ALL) parameter on OPNDBF or open the file in another (earlier) RPG program that has all options covered "UF A".
Another choice would be to swallow the message. I'm assuming you have a Subfile Program Message Queue on the screen and that message is "just appearing" in that subfile msgq?
To do that, call the RMVMSG API from within your RPG program immediately after the file is open. If you use the OPEN opcode, call it right after that. Otherwise try it as the first line of Calc specs. If that doesn't work, change the file to USROPN, open the file "manually" and then call the RMVMSG API. Here's how I call that API some of my programs to remove rogue messages:
D QmhRmvPM PR ExtPgm('QMHRMVPM') D CallStackEntry... D 4096A Const OPTIONS(*VARSIZE) D CallStackCount 10I 0 Const D msgKey 4A Const D msgToRemove 10A Const D api_error 16A OPTIONS(*VARSIZE:*NOPASS) D apiDS S 16A Inz(*ALLX'00') /free QMHRMVPM('*' : 0 : ' ' : '*NEW' : apiDS) /end-free
I believe the typical option I have seen used is to clear the message subfile during program initialization and immediately following the exfmt. This ensures that the program does not display messages that are generated during file opens, and other program initialization functions. And after the screen has been displayed with errors and informational messages, those are cleared before the errors are checked again.