Note: Built-In Function Rules Usage Options
Gets the description associated with a message number in a message file.
Normally the returned message details are then processed or printed by the RDML function.
Arguments
|
Return Values
|
Example
Execute a subroutine to print an error / exception report. The subroutine is passed an error message number.
DEFINE FIELD(#ERRTXT) TYPE(*CHAR) LENGTH(132)
LABEL('Error :')
DEFINE FIELD(#TEXT) TYPE(*CHAR) LENGTH(132)
DEFINE FIELD(#MSGID) TYPE(*CHAR) LENGTH(7)
DEFINE FIELD(#MSGT) TYPE(*CHAR) LENGTH(132)
DEF_LINE NAME(#NAME) FIELDS(#CUSTNO #ADDRESS1 #ADDRESS2 #ZIPCODE)
DEF_LINE NAME(#ERROR) FIELDS(#ERRTXT) IDENTIFY(*LABEL)
' ' Some processing ' '
' ' ' '
INSERT FIELDS(#NAME) TO_FILE(NAMES) VAL_ERROR(*NEXT)
IF_STATUS IS_NOT(*OKAY)
PRINT LINE(#NAME)
CHANGE FIELD(#TEXT) TO('xxxxxxx')
EXECUTE SUBROUTINE(ERRPRT) WITH_PARMS(ERR0003 #TEXT)
ENDIF
' ' More processing ' '
' ' ' '
SUBROUTINE NAME(ERRPRT) PARMS(#MSGID)
USE BUILTIN(GET_MESSAGE_DESC) WITH_ARGS(#MSGID #ERRFILE
'''*LIBL''' #TEXT) TO_GET(#MSGT)
PRINT LINE(#ERROR)
ENDROUTINE