The Send Status Message command simplifies the interface for sending
and removing status messages from either CL or a HLL program.
** Assume you have a CL program where you want to send a status
message before creating an outfile and then blank the status
message line following the outfile creation, you would
specify:
SNDSTSMSG MSG('DSPOBJD outfile being created.')
DSPOBJD ... OUTFILE(xxx)
SNDSTSMSG MSG(*REMOVE)
** Assume you have an RPG program where you want to send a status
message. You would specify:
CALL 'SNDSTS'
PARM MSG 80
You would move the text of the message you want sent into the
MSG field. When you want to remove the message, you would use
the same call with the value *REMOVE left adjusted in the MSG
field.
Up to 80 bytes of text can be sent as a status message.
The *REMOVE function does not actually remove a status message, but
sends the system message CPI9801 which is designed for blanking out
the status message line on the display.
The command uses the QMHSNDPM API so the performance approximates
sending a status message using SNDPGMMSG.
DLY Parameter
-------------
The DLY parameter on SNDSTSMSG ensures that the message will be
displayed for at least the specified number of seconds. The intent
of this parameter is for when the function to be performed that you
want to describe in the status message may last momentarily or for
several seconds.
By specifying a DLY value, the status message will appear for the
minimum number of seconds described.
The DLY function is performed by automatically creating the TAASNDSTS
data area in QTEMP whenever the DLY parameter is used. The data area
contains the value of the current time plus the number of seconds
requested.
When a second SNDSTSMSG is run, the data area is checked and if a
value exists, the command will delay until the time is reached. Note
that this also occurs if *REMOVE is requested. The *REMOVE function
will delay and then delete the TAASNDSTS data area.
The DLY function is only provided on the SNDSTSMSG command (not on
the SNDSTS program).
Removal of status messages
--------------------------
There is only room for one status message on a display. By default,
the message appears on the last line of the display.
There are several methods of removing a status message:
** Using another status message to overlay the first message.
** Using SNDSTSMSG with MSG(*REMOVE).
This blanks the status line. The same function can be
performed by using the API QMHSNDPM directly or using
SNDPGMMSG MSG(CPI9801) TOPGMQ(*EXT) MSGTYPE(*STATUS)
** Returning to command entry.
** Opening a display file.
Command parameters *CMD
------------------
MSG The message text desired. An expression can be
used. Up to 80 bytes can be entered. No period is
added at the end of the text.
The special value *REMOVE may be specified to remove
the status message. When *REMOVE is requested, the
TAASNDSTS data area in QTEMP is deleted.
DLY The number of seconds to ensure that the status
message will exist at a minimum. The default is
*NONE meaning 0 delay.
A value of 0 to 100 may be entered to ensure the
message appears for at least that period of time.
If another SNDSTSMSG occurs prior to the delay time,
the job will wait and then the second SNDSTSMSG
function is performed.
The intent of this parameter is to allow the status
message to be read by the user when it is not known
what the duration of a potentially long running
function will be. For example, if you want a status
message during the creation of an outfile and the
number of records written will vary based on a user
request, the time required could vary from less than
a second to many seconds. In addition, the same
function performed on different CPU models will also
cause differences.
By specifying a DLY value, you can ensure that the
status message will be read long enough to be read.
JOBLOG A *YES/*NO/*BATCH parameter for whether to send the
message to the job log.
*NO is the default.
*YES may be specified to send the message to the job
log. If the job is operating interactively, the
message is sent to both the interactive display and
to the job log. If the job is operating in batch,
the message is sent to the job log.
*BATCH may be specified to send the message to the
job log if the job is operating in batch.
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
ADDTIM Add time
CLCTIMDIF Calculate time difference
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SNDSTSMSG *CMD TAAMSGR QATTCMD
TAAMSGRC *PGM CLP SNDSTS QATTCL
TAAMSGRC2 *PGM CLP TAAMSGRC2 QATTCL
A data area named TAASNDSTS is created in QTEMP if DLY(xx) is used.
|