Change Message File (CHGMSGF)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Change Message File (CHGMSGF) command changes the attributes of a specified message file or a list of message files.

Restrictions

  1. Only libraries to which you have use (*USE) authority for are searched.
  2. You must have *USE and delete (*DLT) authorities for the message file.
Top

Parameters

Keyword Description Choices Notes
MSGF Message file Qualified object name Required, Key, Positional 1
Qualifier 1: Message file Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL, *ALLUSR, *ALL
TEXT Text 'description' Character value, *SAME, *BLANK Optional
CCSID Coded character set ID 1-65535, *SAME, *HEX, *MSGD, *JOB Optional, Positional 2
Top

Message file (MSGF)

Specifies the message file or files whose attributes are being changed.

This is a required parameter.

Qualifier 1: Message file

*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 to be changed. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk is a substitute for any valid character. 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. 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.
name
Specify the name of the message file whose attributes are to be changed.

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 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 thread's library list are searched.
*ALL
All libraries in the system, including QSYS, are searched.
*ALLUSR
All user libraries are searched. All libraries with names that do not begin with the letter Q are searched except for the following:

#CGULIB     #DSULIB     #SEULIB
#COBLIB     #RPGLIB
#DFULIB     #SDALIB

Although the following Qxxx libraries are provided by IBM, they typically contain user data that changes frequently. Therefore, these libraries are considered user libraries and are also searched:

QDSNX       QRCLxxxxx   QUSRIJS     QUSRVxRxMx
QGPL        QSRVAGT     QUSRINFSKR
QGPL38      QSYS2       QUSRNOTES
QMGTC       QSYS2xxxxx  QUSROND
QMGTC2      QS36F       QUSRPOSGS
QMPGDATA    QUSER38     QUSRPOSSA
QMQMDATA    QUSRADSM    QUSRPYMSVR
QMQMPROC    QUSRBRM     QUSRRDARS
QPFRDATA    QUSRDIRCL   QUSRSYS
QRCL        QUSRDIRDB   QUSRVI

  1. 'xxxxx' is the number of a primary auxiliary storage pool (ASP).
  2. A different library name, in the format QUSRVxRxMx, can be created by the user for each previous release supported by IBM to contain any user commands to be compiled in a CL program for the previous release. For the QUSRVxRxMx user library, VxRxMx is the version, release, and modification level of a previous release that IBM continues to support.
name
Specify the name of the library to be searched.
Top

Text 'description' (TEXT)

Specifies text that describes the message file. The text specified replaces any previous text.

*SAME
The text, if any, is not changed.
*BLANK
No text is specified.
'description'
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Coded character set ID (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 Add Message Description (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 CCSID associated with the message file is not changed.
*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 calling 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 CCSIDs that a job can be changed to are accepted. See the Globalization information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter 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 is 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 iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

Top

Examples

CHGMSGF   MSGF(*ALL/*ALL)  CCSID(65534)

This command changes the CCSID to 65534 for all of the message files on the system.

Top

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.
CPF247E
CCSID &1 is not valid.
CPF2483
Message file currently in use.
CPF9830
Cannot assign library &1.
Top