CHGMSGF (Change Message File)
CHGMSGF Command syntax diagram
Purpose
The Change Message File (CHGMSGF) command changes the attributes of a specified message file or a list of message files.
Restrictions
- Only libraries to which you have *USE authority are searched.
- You must have *USE and *DLT authorities to the message file.
Required Parameters
- MSGF
- Specifies the name of the message file or files whose attributes are being changed.
The name of the message file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
*USRLIBL: Only the libraries in the user portion of the job's library list are searched.
*ALL: All libraries in the system, including QSYS, are searched.
library-name: Specify the name of the library to be searched.
*ALL: All message files in the libraries identified in the library qualifier are changed.
generic*-message-file-name: Specify the generic name of the message file whose attributes are being changed. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name. See generic names for additional information.
If the complete object name is specified and the library qualifier is *USRLIBL, *ALL, or *ALLUSR, all message files of the specified name are changed.
message-file-name: Specify the name of the message file whose attributes are being changed.
Optional Parameters
- CCSID
- Specifies the coded character set identifier (CCSID) that is to be associated with the message file. This will not result in any text conversions on the message descriptions that already exist in the message file. Any message descriptions subsequently added to this message file will be converted from the CCSID specified on the ADDMSGD command to the CCSID of the message file. The CCSID associated with the message file overrides the CCSID associated with the message description. To use the CCSID associated with the message description, change the CCSID associated with the message file to *MSGD.
*SAME: The value does not change.
*HEX: The CCSID associated with the message file is changed to 65535. 65535 means that no conversions are to occur when adding or changing message descriptions to the message file and no conversions are to occur when retrieving message descriptions from the file. The CCSID specified on the ADDMSGD or CHGMSGD commands is saved in case this message file is ever changed to *MSGD.
*MSGD: The CCSID associated with the message file is changed to 65534. 65534 means to use the CCSID associated with the message description when retrieving message text from the file. When adding or changing message descriptions to the message file, no conversions are to occur and the message description is tagged with the CCSID specified on the ADDMSGD or CHGMSGD commands.
*JOB: The CCSID associated with the message file is changed to the CCSID of the job that is running this command.
coded-character-set-identifier: Specify the coded character set identifier (CCSID) that is to be associated with the message file. The valid values range from 1 through 65535. Only those CCSID values that a job can be changed to are accepted. See the Globalization topic in the Information Center for a list of valid CCSID values.
Note: Changing the CCSID associated with the message file does not change the CCSID associated with the message descriptions. If the message file CCSID is ever changed back to *MSGD the original CCSIDs associated with the message descriptions are remembered. Changing the CCSID associated with a message file that contains message descriptions may cause unpredictable results. This can occur when the character encoding of those message descriptions do not match the CCSID specified. Only change the CCSID of a message file that contains message descriptions to correct a message file CCSID. The change can be made when a message file CCSID does not match the encoding of its message descriptions.
For more information on the message handler and its use of CCSIDs, see the Globalization topic in the Information Center.
- TEXT
- Specifies the text that briefly describes the message file. More information is in Commonly used parameters. The text specified replaces any previous text.
*SAME: The value does not change.
*BLANK: Text is not specified.
'description': Specify no more than 50 characters of text, enclosed in apostrophes.
Example for CHGMSGF
CHGMSGF MSGF(*ALL/*ALL) CCSID(65534)This command changes the CCSID to 65534 for all of the message files on the system.
Error messages for CHGMSGF
*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.
- CPF247E
- CCSID &1 is not valid.
- CPF2483
- Message file currently in use.
- CPF9830
- Cannot assign library &1.