CRTMNU (Create Menu)
Purpose
The Create Menu (CRTMNU) command creates a menu object. Both Display File (*DSPF) and Program (*PGM) menus can be created by using this command. A menu can be shown by using the Go to Menu (GO) command.
Restriction: The user must have *CHANGE, *READ, and *ADD authority for the library where the menu is being created.
Required Parameters
- MENU
- Specifies the qualified name of the library where the menu is being created.
The name of the menu can be qualified by one of the following library values:
*CURLIB: The menu 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 menu is created.
menu-name: Specify the name of the menu.
- TYPE
- Specifies the type of menu being created.
*DSPF: An existing display file and message file are used to create a menu like those used in the System/36 environment.
*PGM: The menu being created calls a program to be run.
*UIM: The menu is created using the UIM tag language found in the file specified on the SRCFILE and SRCMBR parameters.
Optional Parameters
- DSPF
- Specifies the qualified name of the display file to use in creating the menu object. The display file must include one record format with the same name as the display file itself; this is called the menu format. Help formats may also be included in the file.
Help formats follow the naming convention #Hxxyy, where xx is the first and yy is the last menu option to which the help format applies. For example, #H0306 would apply to menu options 3 to 6. #H0000 designates the general help for the menu.
The display file must have a separate indicator area (INDARA keyword) and contain no subfile descriptions.
This parameter may be specified only if TYPE(*DSPF) is chosen.
The name of the display 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.
library-name: Specify the name of the library to be searched.
*MENU: The display file has the same name as the menu specified on the MENU parameter.
display-file-name: Specify the display file name to use if it is not the same as that specified on the MENU parameter.
- MSGF
- Specifies the qualified name of the message file that contains the commands to run when a menu option is selected. The MSGIDs of the messages in this file are of the form USRxxxx where xxxx is the menu option number typed on the command line.
Note: If the message file being created is to be used for menus, add message file members to the file using the Add Message Description (ADDMSGD) command. 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.
library-name: Specify the name of the library to be searched.
*MENU: The message file that contains the commands to run has the same name as the menu specified on the MENU parameter.
message-file-name: Specify the message file name to use if it is not the same as that specified on the MENU parameter.
- CMDLIN
- Specifies that the user can select a long command line, a short command line, or no command line (an option line).
*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.
- DSPKEY
- Specifies whether the function key legend is shown at the bottom of the menu display.
*NO: The function key legend is not shown at the bottom of the menu display.
*YES: The function key legend is shown at the bottom of the menu display.
- PGM
- Specifies the qualified name of the program to call when the menu is run.
Three parameters are passed to the program:
- The first parameter is the ten-character menu object name that identifies the program to call.
- The second parameter is the ten-character name of the library that contains the menu object.
- The third parameter is a two-character binary return code declared as a variable in the called program. The program must set one of the following return codes:
Return Code Hex Description 0 0000 Call the program (display the menu) again -1 FFFF Exit function requested -2 FFFE Previous function requested -4 FFFC Home function requested (display the home menu)The name of the program 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.
library-name: Specify the name of the library to be searched.
*MENU: The called program has the same name as the menu specified on the MENU parameter.
program-name: Specify the name of the program to call if it is not the same as that specified on the MENU parameter.
- SRCFILE
- Specifies the name of the source file containing the menu description source statements.
The name of the source 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.
library-name: Specify the name of the library to be searched.
QMNUSRC: The source file QMNUSRC contains the menu description source statements.
source-file-name: Specify the name of the source file containing the menu description source statements.
- SRCMBR
- Specifies the member of the source file containing the menu description.
*MENU: The name specified on the MENU parameter is used for the name of the source member containing the menu description.
source-member-name: Specify the name of the member containing the menu description.
- OPTION
- Specifies whether a source listing is produced when the menu is created.
Source Listing Options
*SRC or *SOURCE: A source listing is produced.
*NOSRC or *NOSOURCE: No source listing is produced unless errors are detected.
*NOSECLVL: Second level text is not provided with the first level text when the messages are printed at the end of the listing.
Second-Level Message Text Options
*SECLVL: Second level text is provided with the first level text when the messages are printed at the end of the listing.
Event File Creation Options
*NOEVENTF: The compiler does not produce an event file for the CoOperative Development Environment/400 (CODE/400) product.
*EVENTF: The compiler produces an event file that can be used by the CODE/400 product. The event file is created as a member in the file EVFEVENT in your object library. The CODE/400 product uses this file to offer error feedback integrated with the CODE/400 editor. This value is normally specified by the CODE/400 product on your behalf.
- INCFILE
- Specifies the name of the source file containing the members being included in the menu.
The name of the source 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.
library-name: Specify the name of the library to be searched.
*SRCFILE: The name specified on the SRCFILE parameter is used.
source-file-name: Specify the name of the source file containing the members to be included on the menu.
Note: If the coded character set identifier (CCSID) of the source file is different than the CCSID of the primary source file specified on the SRCFILE parameter, the CCSID is changed to the CCSID of the primary source file. The CCSID must be the same for all source members of the menu object.
- CURLIB
- Specifies the name of the library being used as the current library for jobs initiated by this user profile.
*NOCHG: The current library for the job 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 when the menu is shown.
library-name: Specify the name of the library that replaces the current library entry in the job's library list.
- PRDLIB
- Specifies the name of the library used as the product library for running the menu.
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. *NOCHG: The product library does not change when the menu is run.
*NONE: The product library entry in the library list is not used while the menu is run.
library-name: Specify the name of the library used as the product library when the menu is run.
Note: After exiting the menu, the product library is restored to the value it had before the menu was run.
- CHRID
- Specifies whether the character identifier (graphic character set and code page) of the menu object is changed to the character identifier of the device when the menu is displayed.
*DEVD: No change occurs. The character identifier of the menu object is the same as the character identifier of the device.
*JOBCCSID: The character identifier of the menu object is changed from the CCSID of the source file specified on the SRCFILE parameter to the character identifier of the device.
- AUT
- Specifies the authority given to users who do not have specific authority to the menu, who are not on an authorization list, and whose user group has no specific authority to the menu.
*LIBCRTAUT: The public authority for the menu is taken from the value on the CRTAUT parameter of the target library (the library that is to contain the menu). The public authority is determined when the menu is created. If the CRTAUT value for the library changes after the menu 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.
*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 menu.
*USE: The user can perform basic operations on the menu, such as running a program or reading a file. The user cannot change the menu. *USE authority provides object operational authority, read authority, and execute authority.
*EXCLUDE: The user cannot access the menu.
authorization-list-name: Specify the name of the authorization list used.
- REPLACE
- Specifies whether an existing menu with the same name is replaced.
Note: The menu cannot be replaced if it is in use by this job or another job. *YES: The existing menu is moved to the system library QRPLOBJ and replaced with the new menu.
*NO: The existing menu is not replaced with the new menu.
- TEXT
- Specifies the text that briefly describes the menu. More information on this parameter is in Commonly used parameters.
*SRCMBRTXT: The text for the menu is obtained from the text associated with the source file member.
*BLANK: Text is not specified.
'description': Specify no more than 50 characters of text, enclosed in apostrophes.
Example for CRTMNU
CRTMNU MENU(ARLIB/ARPERS) TYPE(*PGM)This command creates a menu named ARPERS in library ARLIB. The menu calls a program (also named ARPERS) when the menu is run.
Error messages for CRTMNU
*ESCAPE Messages
- CPF6AC3
- Menu not created.