CRTMSGF (Create Message File)

CRTMSGF Command syntax diagram

 

Purpose

The Create Message File (CRTMSGF) command creates a user-defined message file for storing message descriptions. The message file should be stored in a library for which all users who use the predefined messages have *USE authority. The system is shipped with the IBM-supplied message files, stored in the system library, QSYS: the CPF message file, QCPFMSG (for the OS/400 system and machine interface messages); and the licensed program message files, such as QRPGMSG (for RPG messages).

 

Required Parameters

MSGF
Specifies the qualified name of the message file being created.

The name of the message file can be qualified by one of the following library values:

*CURLIB: The message file is created in the current library for the job. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library where the message file is created.

message-file-name: Specify the name of the message file being created.

 

Optional Parameters

SIZE
Specifies the initial storage size of the message file, the size of each increment added to increase its storage size, and the number of times the storage size can be incremented. The storage size is expressed in kilobytes (Kbytes). The message file size is increased when source file space is needed for the addition of a message description. The minimum size allowed is 1 Kbyte, the maximum allowed is 16,000 Kbytes (16 Megabytes). If SIZE is not specified, SIZE(10 2 *NOMAX) is assumed.

Element 1: Initial Size

One of the following values is used to specify the initial storage size of the message file.

10: Initially, the message file has 10 Kbytes of storage assigned to it (1 Kbyte equals 1024 bytes of storage).

initial-K-bytes: Specify the initial size of the file, which cannot equal 0.

Element 2: Increment Value

One of the following values is used to specify the amount of storage in kilobytes that is added each time the message file's size is incremented.

2: The message file size is increased by 2 Kbytes of storage for each increment added.

increment-value: Specify the number of kilobytes added for each increment.

Element 3: Maximum Number of Increments

One of the following values is used to specify the maximum number of increments that can be added to increase the message file's size.

*NOMAX: The system maximum is used.

number-of-increments: Specify the maximum number of increments that can be added to increase the message file size. Enter a 0 to prevent any increases in the initial size of the file.

AUT
Specifies the authority given to users who do not have specific authority to the message file, who are not on an authorization list, and whose user group has no specific authority to the message file.

*LIBCRTAUT: The public authority for the message file is taken from the value on the CRTAUT parameter of the target library (the library that is to contain the message file). The public authority is determined when the message file is created. If the CRTAUT value for the library changes after the message file is created, the new value does not affect any existing objects.

*CHANGE: The user can perform all operations on the object except those limited to the owner or controlled by object existence authority and object management authority. The user can change and perform basic functions on the object. Change authority provides object operational authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove user ids.

*ALL: The user can perform all operations except those limited to the owner or controlled by authorization list management authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the message file.

*USE: The user can perform basic operations on the message file. The user is prevented from changing the message file. Use authority provides object operational authority, read authority, and execute authority.

*EXCLUDE: The user cannot access the message file.

authorization-list-name: Specify the name of the authorization list used.

CCSID
Specifies the coded character set identifier (CCSID) that is to be associated with the message file. The CCSID associated with the message file always 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. For more information on message handler and its use of CCSIDs, see the Globalization topic in the Information Center.

*HEX: The CCSID that is associated with the message file is set to 65535. The 65535 CCSID means that no conversions are to occur when adding or changing message descriptions in the message file and no conversions are to occur when retrieving message descriptions from the file. The CCSID associated with the message description is saved in the event the message file is ever changed to *MSGD.

*MSGD: The CCSID that is associated with the message file is set to 65534. The 65534 CCSID means to use the CCSID associated with the message description when retrieving message text from the file. When adding or changing message descriptions in the message file, no conversions are to occur. The message description is tagged with the CCSID specified on the ADDMSGD or CHGMSGD commands.

*JOB: The CCSID that is associated with the message file is the CCSID of the job calling this command.

coded-character-set-identifier: Specify the CCSID that the message file is to be created with. Any message descriptions added to this message file are converted from the CCSID specified to the CCSID of the message file. Valid values range from 1 through 65535. See the Globalization topic in the Information Center for a list of valid CCSID values. Only CCSID values that a job can be changed to are accepted.

TEXT
Specifies the text that briefly describes the message file. More information on this parameter is in Commonly used parameters.

*BLANK: Text is not specified.

'description': Specify no more than 50 characters of text, enclosed in apostrophes.

Example for CRTMSGF

CRTMSGF   MSGF(INVLIB/INVMSGS)
  TEXT('Inventory Application Messages')

This command creates a message file named INVMSGS in which predefined inventory application messages are stored. The file is stored in the library INVLIB, for which all users of the file must have *USE authority. Because the AUT parameter is defaulted, all users have *CHANGE authority for the file, meaning they can retrieve messages from the file.

Error messages for CRTMSGF

*ESCAPE Messages

CPF2108
Object &1 type *&3 not added to library &2.
CPF2112
Object &1 in &2 type *&3 already exists.
CPF2113
Cannot allocate library &1.
CPF2151
Operation failed for &2 in &1 type *&3.
CPF2182
Not authorized to library &1.
CPF2283
Authorization list &1 does not exist.
CPF2402
Library &1 not found
CPF247E
CCSID &1 is not valid.
CPF2497
Size for &1 in &2 exceeds machine limit.
CPF9838
User profile storage limit exceeded.