Re: IBM i messages
Richard Schoen <richard-DiTrGpQEJGItADg8e/3/[email protected]> Tue, 7 Nov 2023 02:06:56 +0000
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <CH0PR12MB52505569B322817878559742B7A9A@CH0PR12MB5250.namprd12.prod.outlook.com> |
Well I sort of think of the CPF message as similar to a return code perhaps in AIX/Unix/PASE/QSH. Except you hva ea 7 character message ID. The fact that you can also send a descriptive error message/desc with a CPF message is kind of like getting feedback from STDOUT or STDERR. In my QShell on i utility I actually have an option to call a QShell/PASE command and check the return codes coming back from PASE calls and also for capturing the STDOUT info as CPF messages if desired instead of writing to a log file. Not sure if that helps but it's something.... Regards, Richard Schoen Web: http://www.richardschoen.net Email: richard-DiTrGpQEJGItADg8e/3/[email protected] ---------------------------------------------------------------------- message: 1 date: Sat, 4 Nov 2023 19:58:44 +0100 from: Mihael Schmidt <mihael-AJkadKwRYCg6GGFevw1D/[email protected]> subject: Re: [C400-L] IBM i messages Hi Patrik, I am not really a C programmer but I can tell you how I use messages in RPG. 1. Writing information into the job log (f. e. with a message of type INFO) 2. Sending a message of type ESCAPE in case something went wrong which I cannot handle in the current place of the code. To tell the caller something went wrong I am sending an ESCAPE message to the caller. The caller can handle the message or not. If he doesn't handle it then the message will go up the call stack to the next one. (This is pretty much how an Exception is Java is working and probably also in a couple of other programming languages.) 3. Give feedback of the progress of a long running program execution to the caller in a 5250 session. The information is automatically displayed in the bottom of the screen. (I don't know any details any more as I haven't coded that for eons ;-) ). 4. ... probably some more cases I currently don't recall ;-) Have a great day! Mihael On 03.11.23 21:50, Patrik Schindler wrote: > Hello, > > I'm seeking out once more to grok IBM i messages, especially QMHSNDPM/QMHRCVPM. There are a lot of examples to be found by Google but those examples always assume context with some actual program implementation. Also, there is documentation from IBM, which largely assumes being born in the OS/400 world. > > Is anyone aware of some writeup, shedding light on the topic from another angle: When someone has UNIX programming experience? This is not necessarily about C but also about ILE RPG. In the end, the programming language shouldn't matter for better understanding. I'm writing to this group because I assume that people programming in C might have a background from other operating systems. > > I'm still thinking that IBM i messages are a bit like UNIX signals, but much more extensive. Opinions are welcome. > > Also, the description of real world use cases for exchanging messages > between applications might help to understand. Things I've found with > Google also were rather complex and way too theoretical for my brain > to digest. ;-) > > Thanks! > > :wq! PoC > > > -- This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/c400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/c400-l.