EDAPRINT: Inserting a Custom Message in the EDAPRINT Log File

How to:

The EDAPRINT function enables you to allocate a sequential file to DDNAME EDAPRINT, add a text message into it, and assign it a message type.

Syntax: How to Insert a Message in the EDAPRINT Log File

EDAPRINT(message_type, 'message')

where:

message_type

Keyword

Can be one of the following message types.

  • I. Informational message.
  • W. Warning message.
  • E. Error message.
'message'

Is the message to insert, enclosed in single quotation marks.

Example: Inserting a Custom Message in the EDAPRINT Log File

The following procedure inserts three messages in the EDAPRINT log file.

DYNAM ALLOC DD EDAPRINT DA USER1.EDAPRINT.LOG SHR REU
-SET &I = EDAPRINT(I, 'This is a test informational message');
-SET &W = EDAPRINT(W, 'This is a test warning message');
-SET &E = EDAPRINT(E, 'This is a test error message');

The following is the contents of the file allocated to DDNAME EDAPRINT after running the request.

00001 04/04/2019 10:52:15.483 I This is a test informational message
00002 04/04/2019 10:52:15.490 W This is a test warning message
00003 04/04/2019 10:52:15.518 E This is a test error message