The Duplicate Message Description (DUPMSGD) Comman

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The Duplicate Message Description (DUPMSGD) command allows you to duplicate a message in a message file. The duplicated message can be in the same or different message files. If the message is duplicated to a different message file, the message ID can be the same or different. This command duplicates most of the parameters of a message.

The command uses four parameters. The first two are FROMID and FROMMSGF. These parameters specify the ID of an existing message in the message file. If the message ID or the message file does not exist, the command sends an escape message to your job.

The last two parameters, TOID and TOMSGF, specify the ID of the duplicated message and the name of the message file where the duplicate is to be added. The TOID parameter must specify a valid message ID or the special default value *FROMID. If you specify *FROMID, the message ID specified in the FROMID parameter is used. The TOMSGF must contain a valid message file name or the special default value *FROMMSGF. If the message ID specified in TOID is already in the message file specified in TOMSGF, the command sends an escape message to your job. You must change either the TOID or the TOMSGF parameter, or both, for the command to run successfully.

After the command completes, the message will be in the TOMSGF if there were no errors. You can then use the Work with Message Description (WRKMSGD) or Change Message Description (CHG-MSGD) commands to change the duplicated version of the message.

We encountered a quirk when we tested this command. If the default value (*FROMMSGF) is used in the to message file (TOMSGF) parameter, the library used to qualify the from message file (FROM-MSGF) parameter is not used to qualify the to message file, as you would expect. This forces you to qualify the TOMSGF parameter if the from message file library qualifier isn't in your library list or if the message file exists more than once in your library list.

Restrictions

The RANGE and REL validity parameters aren't duplicated; the defaults are taken.

A maximum of 40 field definitions for message data are duplicated.

Required Parameters

FROMID Specify the message ID to be duplicated.

FROMMSGF Specify the qualified name of the message file that contains the message identified in FROMID. The possible library values are:

*LIBL: The library list is used to locate the message file. library-name: Specify the name of the library that contains the message file.

message-file-name: Specify the name of the message file containing the message to be duplicated.

Optional Parameters

TOID Specify the message ID of the new message.

*FROMID: The message ID specified in FROMID is used. message-ID: Specify the message ID for the duplicated message.

TOMSGF Specify the qualified name of the message file to contain the new message identified in TOID. The possible library values are:

*LIBL: The library list is used to locate the message file.

library-name: Specify the name of the library that contains the message file.

*FROMMSGF: The message file is the same as the message file specified in FROMMSGF.

message-file-name: Specify the name of the message file that is to contain the new message.

Example

 DUPMSGD FROMID(UMS0001) + FROMMSGF(MYLIB/MYMSGF) + TOID(UMS0002) 

This command creates a duplicate of message UMS0001, which is contained in message file MYMSGF in library MYLIB. The new message ID is UMS0002, and it is placed into the same message file.

Source Members

 INFO: DUPMSGD (QATTINFO) CDO: TAAMSGJ (QATTCMD) CPP: TAAMSGJC (QATTCL) RPG: TAAMSGJR (QATTRPG) 

These tools are documented in Midrange Computing's QUSRTOOL Command Reference. The manual contains explanations and syntax diagrams for more than 300 useful tools.

BLOG COMMENTS POWERED BY DISQUS