get_messageThis is a featured page

Gets the details of the next message from the program queue of the RDML function.
Normally the returned message details are then processed or printed by the RDML function in some non-standard way.
Messages on the program queue of an RDML function normally displayed on line 22/24 of the next screen presented to the user and then automatically cleared / removed.
Messages may have been placed on the program message queue by operating system commands, Built-In Functions, invalid I/O requests and/or RDML commands such as MESSAGE, VALUECHECK, etc.

Arguments:
NumberTypeRequired or OptionalDescriptionMinimum LengthMaximum LengthMinimum DecimalsMaximum Decimals
1AlphaOptionalRemove message from queue Y - message is removed N - message is not removed Default value is Y. 11



Return Values:
NumberTypeRequired or
Optional
DescriptionMinimum LengthMaximum LengthMinimum DecimalsMaximum Decimals
1AlphaRequiredMessage return code
OK = message returned
NO = no message found
22

2AlphaOptionalMessage text 1132

3AlphaOptionalMessage number 17

4AlphaOptionalMessage file name 110

5AlphaOptionalMessage file library110

6AlphaOptionalMessage substitution variable 1132


RDML Example:
Insert a new name and address into file NAMES in a batch program. If an error is detected, print details of the name and address an exception report with all associated error messages.
DEFINE FIELD(#ERRTXT)TYPE(*CHAR)LENGTH(100) LABEL('Error:')
DEF_LINE NAME(#NAME)FIELDS(#CUSTNO#ADDRESS1 #ADDRESS2#ZIPCODE)
DEF_LINE NAME(#ERROR)FIELDS(#ERRTXT)IDENTIFY(*LABEL)

INSERT FIELDS(#NAME)TO_FILE(NAMES)VAL_ERROR(*NEXT)
IF_STATUS IS_NOT(*OKAY)
PRINT LINE(#NAME)
USE BUILTIN(GET_MESSAGE)TO_GET(#RETCODE#ERRTXT)
DOWHILE COND('#RETCODE=OK')
PRINT LINE(#ERROR)
USE BUILTIN(GET_MESSAGE) TO_GET(#RETCODE#ERRTXT)
ENDWHILE
ENDIF
Note: Running the same program under System i and in LANSA SuperServer mode will produce different messages.

A retrieved message using this BIF on the System i will display:
Messagetext:Recordtobeupdatedhasbeenchangedbyanotherjob/user
Messagenumber:IOM0017
Messagefilename:DC@M01

Running in LANSA SuperServer mode (against the System i) will display:
Messagetext:Recordtobeupdatedhasbeenchangedbyanotherjob/user
Messagenumber:*STCMSG
Messagefilename:2

This is a design consideration that, due to technical complexities, will not be changed in the short term.


petewood
petewood
Latest page update: made by petewood , Oct 28 2008, 8:44 AM EDT (about this update About This Update petewood reformatted example - petewood

18 words added
9 words deleted

view changes

- complete history)
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)