Create Message File (CRTMSGF)

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

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 are to use the predefined messages have 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).

Top

Parameters

Keyword Description Choices Notes
MSGF Message file Qualified object name Required, Positional 1
Qualifier 1: Message file Name
Qualifier 2: Library Name, *CURLIB
TEXT Text 'description' Character value, *BLANK Optional
SIZE File size Element list Optional, Positional 2
Element 1: Initial storage size Integer, 10
Element 2: Increment storage size Integer, 2
Element 3: Maximum increments Integer, *NOMAX
AUT Authority Name, *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE Optional
CCSID Coded character set ID 1-65535, *HEX, *MSGD, *JOB Optional
Top

Message file (MSGF)

Specifies the message file to be created.

This is a required parameter.

Qualifier 1: Message file

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

Qualifier 2: Library

*CURLIB
The current library for the job is used to create the message file. If no current library entry exists in the library list, the QGPL library is used.
library-name
Specify the library where the message file is to be created.
Top

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*BLANK
No text is specified.
'description'
Specify no more than 50 characters, enclosed in apostrophes.
Top

File size (SIZE)

Specifies the initial storage size of the message file, the amount of each increase in its storage, and the number of times the size can be increased. The storage size is expressed in kilobytes (KB). (1KB equals 1024 bytes of storage.)

Element 1: Initial storage size

10
The message file has 10 KB of storage assigned to it.
initial-Kilobytes
Specify the initial size of the file (must be greater than 0).

Element 2: Increment storage size

2
2 KB of storage is added to the message file each time its size is increased.
increment-value
Specify the number of kilobytes added each time the message file's size is increased.

Element 3: Maximum increments

*NOMAX
The amount added to the message file is not limited by the user. The maximum size is determined by the system.
number-of-increments
Specify the maximum number of times that a message file's size can be increased. Specify a 0 to prevent any additions to the initial size of the file.
Top

Authority (AUT)

Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.

*LIBCRTAUT
The system determines the authority for the object by using the value specified for the Create authority (CRTAUT) parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will 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 (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) 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 object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
name
Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.
Top

Coded character set ID (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 iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

*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 information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter for a list of valid CCSID values. Only CCSID values that a job can be changed to are accepted.
Top

Examples

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.

Top

Error messages

*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.
Top