CHGOBJD4 CHANGE OBJECT DESCRIPTION 4 TAAOBMV |
The Change Object Description 4 command provides a general purpose
solution when a program wants to prompt for a CHGxxx command. Only
typical object types and attributes are supported. Assuming you have
provided a proper interface to CHGOBJD4, the command will complete
normally whether the change has been made, the command prompt was
cancelled, or the command failed. The ESCMSGID parameter will be
blank if a successful change was made.
Assume your program is reading objects from a DSPOBJD outfile and you
want to allow the user to change the object. A typical series of
commands would be:
DCLF FILE(QADSPOBJ)
DCL &ESCMSGID *CHAR LEN(7)
DCL &MSGTXT *CHAR LEN(75)
DCL &DIAGMSGID *CHAR LEN(7)
DCL &DIAGMSGTXT *CHAR LEN(75)
.
CHGOBJD4 OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) +
MSGTXT(&MSGTXT) ESCMSGID(&ESCMSGID) +
DIAGMSGID(&DIAGMSGID) DIAGMSGTXT(&DIAGMSGTXT)
IF (&ESCMSGID *EQ ' ') DO /* Successful *.
/* */
/* Your handling of a successful change */
/* */
ENDDO /* Successful */
IF (&ESCMSGID *NE ' ') DO /* Failed */
/* */
/* Your handling of a failure */
/* */
ENDDO /* Failed */
If the CHGxxx command completes successfully and returns a completion
message, the MSGTXT variable will contain the first 75 bytes of the
completion message type. The ESCMSGID parameter will be blank.
If an error occurs when the command is run, the ESCMSGID parameter
will contain the system escape ID and the MSGTXT parameter will
contain the first 75 bytes of the message text. If a diagnostic
message also exists, the DIAGMSGID and DIAGMSGTXT return values will
also be filled with the information for the first diagnostic message.
If the user cancels the command prompt, CPF6801 ('Command prompting
ended ...') will be returned for the ESCMSGID parameter and the
CPF6801 error text will be in the MSGTXT return value.
If the object type (or attribute) is not supported, TAA9891 will be
returned for the ESCMSGID parameter with appropriate text in the
MSGTXT parameter.
Using RTVOBJD
-------------
If you are using RTVOBJD instead of reading the DSPOBJD outfile, you
may also follow it with the CHGOBJD4 command.
CHGOBJD4 escape messages you can monitor for
--------------------------------------------
None.
CHGOBJD4 Command parameters *CMD
---------------------------
OBJ The qualified name of the object to be changed. The
library value defaults to *LIBL. A specific library
or *CURLIB may also be used.
OBJTYPE The object type to be changed. Only typical object
types and attributes are supported.
ESCMSGID The escape message ID if the CHGxxx command failed
or was cancelled. If the command completes
successfully, ESCMSGID will be blank. This is a
required return variable that must be specified as
*CHAR LEN(7).
MSGTXT The first 75 bytes of either the completion message
(if any) or the escape message. This is a required
return variable that must be specified as *CHAR
LEN(75).
DIAGMSGID The diagnostic message ID if the CHGxxx command
failed and a diagnostic message type exists. Only
the message ID of the first diagnostic message is
returned. If the command completes successfully,
the value will be blank. This is a required return
variable that must be specified as *CHAR LEN(7).
DIAGMSGTXT The first 75 bytes of the first diagnostic message
associated with the escape message. If no
diagnostic message occurred, the value will be
blank. This is a required return variable that must
be specified as *CHAR LEN(75).
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHGDTAQD Change data queue description
CHKOBJ3 Check object 3
RTVDTAQD Retrieve data queue description
SNDESCINF Send escape information
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CHGOBJD4 *CMD TAAOBMV QATTCMD
TAAOBMVC *PGM CLP TAAOBMVC QATTCL
|
Added to TAA Productivity tools January 15, 2014