Marc's Place


E$PGMMSG - Send a message or retrieve object attributes

Start Command

call e$pgmmsg (<request> <message data structure> <queue> <program>)

Call Parameters

request (a4)
Action to perform:
Value: *SND
This value instructs the program use the data in the message data structure to send a message from a messagefile to the specified queue.
Value: *OBJ
This value instructs the program to retrieve a job attribute and attributes from a *PGM object, specified in queue (the name of the library) and program.
message data structure (a161)

Sending a message
The structure has the following subfields when used for sending a message: 
  • Message Identifier: MSGID, Postions 1-7
    The message id is used to retrieve message text from a message file.
  • Message Severity: MSGSV, Positions 8-9
    The severity of the message is retrieved from the message definition and returned to the calling program through this subfield.
  • Message Data: MSGDT, Positions 10-141
    Message data is used for variables defined within the message text (&1, &2, etc.) and used by the message sending command SNDPGMMSG.
  • Message File: MSGFL, Positions 142-161
    This subfield contains two fields of 10 characters each:
    • Library
      The name of the library of the message file to use. Standard value is *LIBL.
    • Messagefile
      The name of the message file to use.
If the message identifier is empty, no message is sent and the message queue *PRV is emptied.
queue (a10)
The name of the message queue to send the message to.
program (a10)
The name of the program that is sending the message.

Return Parameters

message data structure (a161)

Retrieve Object- and Jobattributes
Data retrieved is returned to the calling programm through this parameter. The structure has the following subfields when used for retrieving data:
  • Object description: TEXT, Positions 1-50
  • OS/400 release where program was compiled: SYSLVL, Positions 51-59
  • Compiler name and release: COMPILER, Positions 60-75
    This field contains two subfields:
    • Compiler name, Positions 1-7 (60-66 of COMPILER)
    • Compiler release, Positions 8-16 (67-75 of COMPILER)
  • Runmode: Job TYPE, Position 76
    This is a job attribute which is converted to 'B' for batch mode and 'I' for interactive mode.
See the source of DS_E$PGM how this data is used.

What it does

Read above.


See FN_E$MSG for a coding example.

Go to download page
© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement