Previous Topic: Action=BUILD Class=IDTEXT

Next Topic: Action=DISPLAY Class=DATA


Action=BUILD Class=MESSAGE

This statement builds a message using a message definition. The BUILD MESSAGE function returns the built message in &SYSMSG.

This statement has the following format:

&CONTROL NOSHRVARS
-EXEC $CACALL   OPT=ACTION
                ACTION=BUILD
                CLASS=MESSAGE
                NAME=‘MESSAGE=message id’
                PARMS=‘PROCNAME=procedure name
                       [P1=parameter1... P10=parameter10]
MESSAGE=message id

A required parameter giving the identifier of the message to be built.

PROCNAME=procedure name

A required parameter giving the name of the procedure that requested the message to be built.

P1=parameter1...P10=parameter10

Optional parameters providing data values to be substituted into the message definition.

Input Variables

This statement has no input variables.

Return Variables

This statement contains the following return variables:

&SYSMSG

System message. Contains either:

Feedback Codes

If a return code of 8 is set, then additional information is available as one of the following feedback codes, set in &$CAFDBK:

1

Definition not found

8

Processing error

10

Nesting level exceeded

Example

The message definition for message SAMP01 is as follows:

VSAM ERROR ON FILE ~P1 RC=~P2 FDBK=~P3

Use the following statements to build the SAMP01 message:

&CONTROL NOSHRVARS
-EXEC $CACALL   OPT=ACTION
                ACTION=BUILD
                CLASS=MESSAGE
                NAME=‘MESSAGE=SAMP01
                PARMS=‘PROCNAME=&0
                       P1=&FILEID
                       P2=&FILERC
                       P3=&VSAMFDBK

&0 contains the name of your procedure; &FILEID, &FILERC, and &VSAMFDBK contain, respectively, the values for ~P1, ~P2, and ~P3 in the message definition.