Change Menu (CHGMNU)

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

The Change Menu (CHGMNU) command can be used to change the following:

Restrictions:

Top

Parameters

Keyword Description Choices Notes
MENU Menu Qualified object name Required, Key, Positional 1
Qualifier 1: Menu Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DSPF Display file Single values: *SAME
Other values: Qualified object name
Optional
Qualifier 1: Display file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
MSGF Message file Single values: *SAME
Other values: Qualified object name
Optional
Qualifier 1: Message file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
CMDLIN Command line *SAME, *LONG, *SHORT, *NONE Optional
DSPKEY Display function keys *SAME, *NO, *YES Optional
PGM Program Single values: *SAME
Other values: Qualified object name
Optional
Qualifier 1: Program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
CURLIB Current library Name, *SAME, *NOCHG, *MNULIB, *CRTDFT Optional
PRDLIB Product library Name, *SAME, *NOCHG, *NONE Optional
TEXT Text 'description' Character value, *SAME, *BLANK Optional
Top

Menu (MENU)

Specifies the menu to be changed.

This is a required parameter.

Qualifier 1: Menu

name
Specify the name of the menu object.

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 menu. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the menu is located.
Top

Display file (DSPF)

Specifies the display file used for the menu. The display file must include one record format with the same name as the display file itself, called the menu format. Help formats can also be included in the file.

Help formats follow the naming convention #Hxxyy, where xx is the first menu option and yy is the last menu option to which the help format applies. (For example, #H0306 would apply to menu options 3 through 6.) #H0000 designates the general help for the menu.

This parameter can be specified only if the menu was created with *DSPF specified for the Menu type (TYPE) parameter on the Create Menu (CRTMNU) command.

Single values

*SAME
The display file name and library do not change.

Qualifier 1: Display file

name
Specify the name of the display file to be used.

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 display file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the display file is located.
Top

Message file (MSGF)

Specifies the message file that contains the commands to run when a menu option is selected. The MSGID's of the messages in this file are of the form USRxxxx, where xxxx is the number of the menu option that is typed on the command line.

This parameter can be specified only if the menu was created with *DSPF specified for the Menu type (TYPE) parameter on the Create Menu (CRTMNU) command.

Single values

*SAME
The message file name and library do not change.

Qualifier 1: Message file

name
Specify the name of the message file to be used.

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 message file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the message file is located.
Top

Command line (CMDLIN)

Specifies whether a long command line, a short command line, or no command line (an option line) is used.

This parameter can be specified only if the menu was created with *DSPF specified for the Menu type (TYPE) parameter on the Create Menu (CRTMNU) command.

*SAME
The command line or option line remains the same.
*LONG
A 153-byte long command line is used.
*SHORT
A 73-byte long command line is used.
*NONE
No command line is used. A 4-byte option line is used.
Top

Display function keys (DSPKEY)

Specifies whether the function key legend appears at the bottom of the menu when the menu is shown.

This parameter can be specified only if the menu was created with *DSPF specified for the Menu type (TYPE) parameter on the Create Menu (CRTMNU) command.

*SAME
The function key legend does not change.
*NO
The function key legend is not shown at the bottom of the display.
*YES
The function key legend is shown at the bottom of the display.
Top

Program (PGM)

Specifies the program to call when the menu is shown.

This parameter can be specified only if the menu was created with *PGM specified for the Menu type (TYPE) parameter on the Create Menu (CRTMNU) command.

Single values

*SAME
The program name and library do not change.

Qualifier 1: Program

name
Specify the name of the program to be called.

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 program. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the program is located.
Top

Current library (CURLIB)

Specifies the library to be used as the current library when the menu is run.

*SAME
The current library for the menu does not change.
*NOCHG
The current library does not change for the processing of this menu.
*MNULIB
The current library is changed to the library containing the menu while the menu is shown.
*CRTDFT
There is no current library while the menu is shown. The current library that was active before the menu was shown (if any) is restored after exiting the menu.
name
Specify the library name used as the current library when the menu is shown.
Top

Product library (PRDLIB)

Specifies the library to be used as the product library while the menu is shown.

Note: The product library for a command or menu remains in the library list while a command or menu is active, unless another command or menu changes the product library. When a command or menu that changed the product library ends, the product library is restored to what it was when the command or library started.

*SAME
The product library for the menu does not change.
*NOCHG
The product library is not changed when the menu is shown and is not restored after exiting the menu.
*NONE
The product library entry in the library list is not used while the menu is shown.
name
Specify the library name to use as the product library while the menu is shown.
Top

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*SAME
The descriptive text does not change.
*BLANK
No text is specified for the menu.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Examples

CHGMNU   MENU(ARLIB/ARPERS)  PGM(ARLIB/PERSLIST)

This command changes the program that is called when a menu named ARPERS, located in library ARLIB, is run. The menu now calls a program called PERSLIST, also located in library ARLIB.

Note that the menu (ARPERS) must have been created with TYPE(*PGM) specified on the Create Menu (CRTMNU) command for the PGM parameter to be specified here.

Top

Error messages

*ESCAPE Messages

CPF6ACD
Menu &1 in &2 is wrong version for system.
CPF6AC2
Menu &1 in library &2 not changed.
Top