Midrange News for the IBM i Community

Posted by: Danny Hayes
has no ratings.
Published: 31 Oct 2012
Revised: 23 Jan 2013 - 2185 days ago
Last viewed on: 16 Jan 2019 (4305 views) 

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.

CPF4123 Published by: Danny Hayes on 31 Oct 2012 view comments(2)

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: CPF4123
Posted: 6 years 2 months 18 days 15 hours 56 minutes ago
Edited: Wed, 31 Oct, 2012 at 10:03:15 (2269 days ago)

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')  
     QMHRMVPM('*' : 0 : ' ' : '*NEW' : apiDS)



Posted by: neilrh
Premium member *
Jackson, MI
Comment on: CPF4123
Posted: 6 years 2 months 18 days 10 hours 55 minutes ago

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.