TAA Tools
BLDRPGMSG       BUILD RPG MESSAGE                      TAARPGJ

The Build  RPG Message tool  is sample  code that you  can copy into  a
program that assists in you in building messages.

The sample code  for you to copy is in member  TAARPGJR in QATTRPG.  It
contains   instructions  for  where  to  place  the  standard  in  your
program.  If  you want  to copy the  code into  your program, you  must
first use  CPYTAA to copy the  TAARPGJR member to a  normal source file
(such as QATTRPG in TAATOOL).

In your program, a typical set of code would be:

     C                     MOVEL'U01'     ZXMSID           Message ID
     C                     EXSR ZXMSG                      Build msg

The  previous code specifies  an Message ID  of U01.   Any 3 characters
can be  used.   It would  be  typical to  use a  letter followed  by  2
digits so that you can scan for a unique value in your program.

You would supply the text of U01 in an array such as:

U01 Simple message of one line.

The message  ID should  be in  the first  3 bytes  followed by  a blank
(for readability).

The  message text  is built up  in the  ZZMSDS data structure  which is
part of the standard code to be  copied into your program.  It is  then
up to your program to  send the message or print it.   For example, you
could   use  the   TAA  Tool   SNDESCMSG,  SNDSTSMSG,   SNDCOMPMSG,  or
SNDDIAGMSG such as:

     C                     CALL 'SNDESC'                   TAA Tool
     C                     PARM           ZXMSDS           Message ID

Or you could use the API (QMHSNDPM) that sends messages.

When  system message  handling support  is used  (also used by  the TAA
Tools that  were mentioned),  the system  formats the  message text  so
that a word is not split over a line.

If  you are  going to  print the  message, you  could consider  the TAA
Tool  FMTLIN which  can  assist you  in formatting  the print  lines so
that words are not split.   See the discussion in the FMTLIN TAA  Tool.

A message  can be  up to  512 bytes  in length.   For  a multiple  line
message, you would enter text such as:

U03 Complex message involving several lines
U03 of text.  A blank will be added to each line.
U03  If you start a sentence with a new record, offset one byte.

You can  concatenate 50 bytes of information on  the end of the message
by just placing data (left adjusted in the ZXMCAT field such as:

     C                     MOVEL'My value'ZXMCAT           Concat area

A demonstration program exists:

           CALL    TAARPGJR2

You can display  the source  of the  demonstration program  to see  how
the messages were  sent.  In  the demonstration, the messages  are sent
as diagnostic types by the TAA Tool SNDDIAGMSG.

Other comments
--------------

You must leave  the dummy array entry as the  last record in the array.

If  you request  a Message  ID that  does not  exist in the  array, the
ZXMSDS area will contain appropriate text (see the demonstration).

The text  is  concatenated  together to  build  the  message.   If  you
concatenate more than  512 bytes, the data is  just truncated (no error
occurs).

Restrictions
------------

None.

Prerequisites
-------------

None.

Implementation
--------------

You  must use CPYTAA to  copy the TAARPGJR member  from the TAA Archive
to a  normal  source  file where  it  can  be  used for  the  SEU  copy
function.  A typical  solution would be to copy  the TAARPGJR member to
the QATTRPG file in TAATOOL.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

                                        TAARPGJR      QATTRPG
   TAARPGJR2     *PGM       RPG         TAARPGJR2     QATTRPG
					

Added to TAA Productivity tools May 1, 1996


Home Page Up to Top