9.96 GET_MESSAGE_DESC

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

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Message number

1

7

 

 

2

A

Req

Message file

1

10

 

 

3

A

Opt

Message file library

1

10

 

 

4

A

Opt

Message substitution value(s)
Multiple substitution values can be used. Substring values together to match message definition. For example, "Function &1 in &2 failed", with substitution values *CHAR7 and *CHAR10 provided. The second value must begin in position 8.

1

132

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Message description

1

132

 

 

 

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