Merge Message File (MRGMSGF)

The Merge Message File (MRGMSGF) command allows you to merge messages from one message file with those in another message file. Another message file may be specified to hold the messages that are replaced during the merging process. None of the message files specified are deleted by this command.

Before the command is processed, messages can be in the from-message file (FROMMSGF), in the to-message file (TOMSGF), or in both files, but not in the replaced-message file (RPLMSGF). The three possibilities result in the following when the MRGMSGF command is processed:

Restrictions: You must have use (*USE) authority for the from-message file (FROMMSGF parameter); use (*USE), add (*ADD), and delete (*DLT) authorities for the to-message file (TOMSGF parameter); and *USE and *ADD authorities for the replace-message file (RPLMSGF parameter).

Parameters

Keyword Description Choices Notes
FROMMSGF From message file Qualified object name Required, Positional 1
Qualifier 1: From message file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
TOMSGF To message file Qualified object name Required, Positional 2
Qualifier 1: To message file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
RPLMSGF Replaced message file Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: Replaced message file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
SELECT Message IDs to select Single values: *ALL
Other values (up to 50 repetitions): Name
Optional
OMIT Message IDs to omit Single values: *NONE
Other values (up to 50 repetitions): Name
Optional

From message file (FROMMSGF)

Specifies the message file from which the messages are to be merged.

This is a required parameter.

Qualifier 1: From message file

name
Specify the name of the message file from which the messages are to be merged.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the from-message file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the from-message file is located.

To message file (TOMSGF)

Specifies the message file into which the messages are to be merged.

This is a required parameter.

Qualifier 1: To message file

name
Specify the name of the message file into which the messages are to be merged.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the to-message file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the to-message file is located.

Replaced message file (RPLMSGF)

Specifies the message file that will receive overlaid messages from the message file specified for the To message file (TOMSGF) parameter.

Single values

*NONE
Overlaid messages from the TOMSGF message file are not copied to a replaced-message file.

Qualifier 1: Replaced message file

name
Specify the name of the message file that will receive overlaid messages.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the replaced-message file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the replaced-message file is located.

Message IDs to select (SELECT)

Specifies selective message IDs to merge from the message file specified for the From message file (FROMMSGF) parameter into the message file specified for the To message file (TOMSGF) parameter. Only the selected messages will be merged.

Note: This parameter cannot be specified if the OMIT parameter is specified.

Single values

*ALL
All message IDs in the from-message file are merged with those in the to-message file.

Other values

message-identifier
Specify a list of up to 50 message IDs to be merged.

Message IDs to omit (OMIT)

Specifies selective message IDs to not be merged from the message file specified for the From message file (FROMMSGF) parameter into the message file specified for the To message file (TOMSGF) parameter. All message IDs in the from-message file not included in this list are merged.

Note: This parameter cannot be specified if the SELECT parameter is specified.

Single values

*NONE
No message IDs are omitted from the merging process.

Other values

message-identifier
Specify a list of up to 50 message IDs not to be merged. All messages whose message IDs are not listed will be merged.

Examples

Example 1: Merging Two Files

MRGMSGF   FROMMSGF(A)  TOMSGF(B)

 Table 1. Contents of the Files Before the Merge
 Message File A       Message File B
 -----------------    -----------------
 ABC1234 'text A4'    ABC1233 'text B3'
 ABC1236 'text A6'    ABC1234 'text B4'
 ABC1237 'text A7'    ABC1235 'text B5'
 ABC1238 'text A8'    ABC1236 'text B6'

Below are the two message files after the MRGMSGF command is processed. Notice that messages ABC1234 and ABC1236 are in both files. When the merge occurs, the message text from file A (text A4 and A6 respectively) replaces the message text in file B (text B4 and B6 respectively).

 Table 2. Contents of the Files After the Merge
 Message File A       Message File B
 -----------------    -----------------
 ABC1234 'text A4'    ABC1233 'text B3'
 ABC1236 'text A6'    ABC1234 'text A4'
 ABC1237 'text A7'    ABC1235 'text B5'
 ABC1238 'text A8'    ABC1236 'text A6'
                      ABC1237 'text A7'
                      ABC1238 'text A8'

Example 2: Merging Two Files with Replace File Option

In the example below, messages that are replaced in the to-file are saved to a separate file before being replaced.

MRGMSGF   FROMMSGF(A)  TOMSGF(B)  RPLMSGF(C)

 Table 3. Contents of the Files Before the Merge
 Message File A       Message File B
 -----------------    -----------------
 ABC1234 'text A4'    ABC1233 'text B3'
 ABC1236 'text A6'    ABC1234 'text B4'
 ABC1237 'text A7'    ABC1235 'text B5'
 ABC1238 'text A8'    ABC1236 'text B6'

Below are the two message files after the MRGMSGF command is processed. Notice that messages ABC1234 and ABC1236 are in both files. When the merge occurs, the text from these two messages is first moved to file C (text B4 and B6 respectively). Then, message text from file A (text A4 and A6 respectively) replaces the message text in file B (text B4 and B6 respectively).

 Table 4. Contents of the Files After the Merge
 Message File A       Message File B       Message File C
 -----------------    -----------------    -----------------
 ABC1234 'text A4'    ABC1233 'text B3'    ABC1234 'text B4'
 ABC1236 'text A6'    ABC1234 'text A4'    ABC1236 'text B6'
 ABC1237 'text A7'    ABC1235 'text B5'
 ABC1238 'text A8'    ABC1236 'text A6'
                      ABC1237 'text A7'
                      ABC1238 'text A8'

Error messages

*ESCAPE Messages

CPF2401
Not authorized to library &1.
CPF2407
Message file &1 in &2 not found.
CPF2411
Not authorized to message file &1 in &2.
CPF2452
Replaced message file must contain no messages.
CPF2461
Message file &1 could not be extended.
CPF2483
Message file currently in use.
CPF2510
Message file &1 in &2 logically damaged.
CPF2519
Error occurred while processing message ID list.
CPF2561
Messages were not merged.
CPF2562
Cannot specify the same message file more than once.
CPF9830
Cannot assign library &1.
CPF9838
User profile storage limit exceeded.