This chapter describes the CL commands used to:
· Create menu options.
· Change, copy, move and delete menu options.
· Control which users can access menu options.
· Reference one menu option from another.
You make functions available to menu users by adding options to menus. Each menu option is associated with a single menu.
Other menu options can reference an option on a central menu, allowing you to provide the same function on many menus. When this technique is used, the option being referenced, and all options that reference it, will always have identical attributes and authorities. Any change to the option being referenced is immediately reflected by all options that reference it.
You can also make similar options available on more than one menu by copying an option from one menu to the other. When this technique is used, the options have identical attributes to begin with, but the attributes may diverge over time. Changes to either of the menu options does not effect the other.
Menu options are implemented as user spaces and stored in library ALC.
Each menu option has several attributes including:
· An option number.
· An associated CL command.
· A text description.
· Authorities.
· Other attributes.
When a menu option references another option, all of the attributes and authorities of the option being referenced are used. Only the option number of the referencing option is used.
A menu option number must be an integer from 1 to 999, or one of the following special values:
|
*START |
This option is executed when the menu is first displayed. |
|
*END |
This option is executed upon exiting the menu. |
|
User-defined function key |
The option is associated with a user-defined function key. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11, and *F13 through *F21. |
The CL command associated with a menu option is executed when the option is selected. The command string can be up to 512 bytes long.
When no command is specified, the menu option appears on the menu as text only and the menu option number does not display. You can create menu options without specifying an associated command to display headings or extra text on the menu.
The text associated with the menu option displays on the menu to the right of the option number. The text for the *START and *END options does not display on the menu. The first 17 characters of the text for user-defined function keys is displayed at the bottom of the menu.
You can selectively authorize users to individual menu options. When a user displays an ALC menu, they only see the options that they are authorized to run. As a result, two different users displaying the same menu may see a different set of options. A single blank line appears on the menu between non-consecutive menu options.
Authority can be specified for:
· *PUBLIC.
· User profiles.
· Group profiles. Multiple group profiles per user are supported.
· Authorization lists.
While you can control access to menu options using many different authority schemes, we recommend the following for its ease-of-use and flexibility:
Determine logical groupings within your organization and then create an iSeries group profile for each group using the OS/400 Create User Profile (CRTUSRPRF) command.
Assign each of your system users to one or more groups using the GRPPRF and SUPGRPPRF parameters of the Create/Change User Profile commands (CRTUSRPRF).
Use only the group profiles to set authorities to ALC menus and menu options. Then, by simply assigning users to groups you give them access to all of the menu options they need.
To restrict some users from accessing any options on a particular menu, restrict authority at the menu level and set the public authority for all of the menu's options to *USE. Only set authorities at the option level if you intend to grant different groups of users a different subset of the menu's options.
The Create ALC Menu Option (CRTALCOPT) command is used to add a new option to a menu.
You can access this command by any of the following methods:
· Use the GO command to display the menu, key F23 and then select option 1 from the pop-up list.
· Select option 21 from the ALC menu.
· Prompt the CRTALCOPT command at any command line.
The prompted version of the CRTALCOPT command is shown below.
Create ALC Menu Option (CRTALCOPT)
Type choices, press Enter.
Menu . . . . . . . . . . . . . . Name
Library . . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB
Command to run . . . . . . . . .
Option number . . . . . . . . . *NEXT 1-999, *NEXT, *START, *END...
Text 'description' . . . . . . .
Authority . . . . . . . . . . . *USE *USE, *EXCLUDE
Additional Parameters
Position . . . . . . . . . . . . *DFT *DFT, *COLUMN, *PAGE
Display attributes . . . . . . . *NONE *NONE, *HI, *RI, *UL, *BL
+ for more values
Color . . . . . . . . . . . . . *DFT *GRN, *WHT, *RED, *TRQ...
Authority to use . . . . . . . . *USER Name, *USER
Prompt . . . . . . . . . . . . . *NO *YES, *NO
Log request . . . . . . . . . . *NO *YES, *NO
Confirm before running . . . . . *NO *YES, *NO
Run in batch . . . . . . . . . . *NO *YES, *NO
Job description . . . . . . . . *USRPRF Name, *USRPRF
Library . . . . . . . . . . . Name, *LIBL, *CURLIB
Batch job name . . . . . . . . . *MENU Name, *MENU
Batch library list . . . . . . . *CURRENT *CURRENT, *JOBD
Reference menu . . . . . . . . . *NONE Name, *NONE
Library . . . . . . . . . . . Name, *LIBL, *CURLIB
Reference option number . . . . 1-999,*START, *END, *F2...
Create Menu Option command.
The parameters for the CRTALCMNU command are described below in the order that they appear on the command prompt. Default values are underlined.
Specify the qualified name of the menu to contain the new option. This is a required parameter.
The possible values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Enter a valid CL command to run when the menu option is selected. You can key F4 to prompt for command parameters.
The possible values are:
|
all-blanks |
No command is associated with the menu option. The menu option text is used for display purposes only. |
|
command-string |
Enter a valid CL command string. To run more than one command, create a simple CL program and call your program from the menu option. |
Enter the number of the option to be created.
The possible values are:
|
*NEXT |
The next available option number for the menu is used. |
|
*START |
A menu startup option will be created. This option is executed when the menu is first displayed. One useful function to perform at menu start time is to set the library list. See the Set Library List (SETLIBLALC) command for a flexible way to change the working library list. |
|
*END |
An ending option will be created. This option is executed upon exiting the menu. One useful function to perform upon exiting a menu is to restore the previously active library list. See the Set Library List (SETLIBLALC) command for a flexible way to restore the previous library list. |
|
User-defined function key |
An option associated with a user-defined function key is created. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11, and *F13 through *F21. |
|
number |
Enter an option number from 1 to 999. |
Specify text that describes the menu option. The text will display on the menu when the option is displayed.
|
Note: |
The text may be truncated on two and three column
menus. For user-defined function keys, only the first 17 characters of
the text is shown. |
The possible values are:
|
description |
Enter up to 50 characters of descriptive text. |
Specify *PUBLIC authority for the menu option. *PUBLIC authority applies to users who are not explicitly authorized to the option.
Users require a minimum of *USE authority to be able to see and execute the menu option.
The possible values are:
|
*USE |
Users are allowed to execute the menu option. |
|
*EXCLUDE |
Users are not allowed to execute the menu option unless they are explicitly granted authority. To grant authority to the menu option for specific users, use the Edit Option Authority (EDTOPTAUT) command. You can also edit the authority for a menu option by positioning the cursor to the menu option and pressing F23 and then selection option 6 from the pop-up window. |
Specify a positioning attribute to force the menu option to be displayed at the beginning of a column or page.
The possible values are:
|
*DFT |
The default position is used. |
|
*COLUMN |
Skip to a new column before displaying the menu option. If the maximum number of columns are already filled on the current page, skip to the first column on the next page. |
|
*PAGE |
Skip to a new page before displaying the menu option. |
Specify display attributes to change the appearance of the menu option. You can specify up to 4 values.
The possible values are:
|
*NONE |
No display options are used. |
|
*HI |
The option text is highlighted. |
|
*RI |
The option text is shown in reverse image. |
|
*UL |
The option text is underlined. |
|
*BL |
The option text blinks. |
Specify the color to use when displaying the menu option.
The possible values are:
|
*DFT |
The default screen color is used. |
|
*GRN |
The option text is green. |
|
*WHT |
The option text is white. |
|
*RED |
The option text is red. |
|
*TRQ |
The option text is turquoise. |
|
*YLW |
The option text is yellow. |
|
*PNK |
The option text is pink. |
|
*BLU |
The option text is blue. |
Specify whether to adopt authority while the menu option is running. The adopted authority is in effect only while the menu option is running. When the option completes, the user reverts to their normal authority.
With adopted authority, you can more easily and effectively restrict access to your production files and programs. This is because access to these objects can be granted on a function-by-function basis—allowing users to access files and programs when performing specifically authorized functions, while not allowing access to the same objects from a command line. See Appendix A for more information about securing your system using adopted authority.
|
Note: |
When adopting authority, all spooled files, journal
entries and log entries show the actual menu user's name, not the name of the
adopted profile. |
The possible values are:
|
*USER |
No extra authority is used. The menu option is run with the user's authority only. |
|
user-profile |
Enter an existing user profile to use for adopting authority. You must have *USE authority to the profile to specify it with this command. The authority from the specified profile is added to the user's own authority while the menu option is running. |
Specify whether to prompt for additional parameters when the menu option is selected.
The possible values are:
|
*NO |
The command associated with the menu option is run without prompting. |
|
*YES |
The prompted version of the command associated with the menu option is displayed when the menu option is selected. The user can change parameter values and then press Enter to run the command. |
Specify whether to place a request message in the job log when the menu option is run.
The possible values are:
|
*NO |
The menu option is not logged to the job log. |
|
*YES |
A request message is placed in the job log when the menu option is run. The user can then key F9 to retrieve the command and execute it again. |
Specify whether the user must confirm that they are sure before the menu option is run.
For sensitive options, specify *YES to prevent the option from being run accidentally.
The possible values are:
|
*NO |
No confirmation is required. |
|
*YES |
The user must confirm that they are sure before the option will run. |
Specify whether to submit a batch job when the user selects the menu option.
A batch job submitted using this parameter will run the command associated with the menu option, and will adopt the authority of the profile specified on the "Authority to use" parameter, if appropriate.
The possible values are:
|
*NO |
The option is run interactively. |
|
*YES |
A batch job is submitted to run the menu option. |
Enter the qualified name of the job description to use when running the menu option in batch. The job description determines the job queue and certain run attributes for the batch job.
This parameter is ignored unless *YES is specified for the "Run in batch" parameter.
The possible values are:
|
*USRPRF |
The job description specified in the user's user profile is used. |
|
job-description |
Enter the name of an existing job description. |
The possible library values are:
|
*LIBL |
The job description is found using the job library list. |
|
*CURLIB |
The job description is found in the current library. |
|
library-name |
The name of the library containing the job description. |
Enter the job name to use when running the menu option in batch.
This parameter is ignored unless *YES is specified for the "Run in batch" parameter.
The possible values are:
|
*MENU |
The batch job name is constructed from the menu name and the option number. |
|
job-name |
Enter a valid system name. |
Enter the initial library list to use when running the menu option in batch.
This parameter is ignored unless *YES is specified for the "Run in batch" parameter.
The possible values are:
|
*CURRENT |
The library list is taken from the user's interactive job. |
|
*JOBD |
The library list is taken from the job description. |
Specify a menu to reference if you want the attributes of this menu option to be identical to those of another menu option. The menu must be an existing ALC menu.
If a value other than *NONE is specified for this parameter, all attributes of this menu option—including the command, text, hold status, display attributes, authority, etc.—are ignored at run time, and the attributes of the referenced menu option are used instead. Any changes to the option being referenced are automatically reflected by this and all other options that reference it.
The possible values are:
|
*NONE |
No other menu option is referenced. |
|
menu-name |
Enter the name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library. |
|
library-name |
The name of the library containing the menu. |
Specify a menu option to reference if you want the attributes of this menu option to be identical to those of another menu option.
This is a required parameter unless *NONE is specified for the "Reference menu" parameter.
The possible values are:
|
*START |
The menu startup option is referenced. |
|
*END |
The menu cleanup option is referenced. |
|
User-defined function key |
A user-defined function key on the specified menu is referenced. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11, and *F13 through *F21. |
|
number |
Specify an option number from 1 to 999. |
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Edit Option Authority (EDTOPTAUT)
Delete ALC Menu Option (DLTALCOPT)
Run ALC Menu Option (RUNALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)
Set Library List (SETLIBLALC)
The Change ALC Menu Option (CHGALCOPT) command is used to change an existing menu option.
You can access this command by any of the following methods:
· Use the GO command to display the menu, key F23 and then select option 2 from the pop-up list.
· Select option 22 from the ALC menu.
· Prompt the CHGALCOPT command at any command line.
The parameters for the CHGALCOPT command are much the same as those for the CRTALCOPT command.
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Create Menu Option (CRTALCOPT)
Copy ALC Menu Option (CPYALCOPT)
Edit Option Authority (EDTOPTAUT)
Delete ALC Menu Option (DLTALCOPT)
Run ALC Menu Option (RUNALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)
Set Library List (SETLIBLALC)
The Copy ALC Menu Option (CPYALCOPT) command is used to copy an existing menu option. The option can be copied to the same menu or a different menu.
You can access this command by any of the following methods:
· Use the GO command to display the menu containing the option to be copied. Key F23 and then select option 3 from the pop-up list.
· Select option 23 from the ALC menu.
· Prompt the CPYALCOPT command at any command line.
The prompted version of the CPYALCOPT command is shown below.

The parameters for the CPYALCOPT command are described below in the order that they appear on the command prompt. Default values are underlined.
Specify the qualified name of the menu containing the option to be copied. This is a required parameter.
The possible values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Enter the number of the option to be copied. This is a required parameter.
The possible values are:
|
*START |
The menu startup option will be copied. This option is executed when the menu is first displayed. |
|
*END |
The ending option will be copied. This option is executed upon exiting the menu. |
|
User-defined function key |
An option associated with a user-defined function key is copied. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11 and *F13 through *F21. |
|
number |
Enter an option number from 1 to 999. |
Enter the target option number for the copy operation. The option number specified cannot already exist on the target menu.
The possible values are:
|
*NEXT |
The option is copied to the next available new option number for the target menu. |
|
*START |
The option is copied to the starting option of the target menu. |
|
*END |
The option is copied to the ending option of the target menu. |
|
User-defined function key |
The option is copied to a user-defined function key on the target menu. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11 and *F13 through *F21. |
|
number |
Enter an option number from 1 to 999. |
Specify the qualified name of the target menu for the copy operation.
The possible single values are:
|
*FROMMENU |
The source and target menus are the same. |
The possible menu values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Create ALC Menu Option (CRTALCOPT)
Edit Option Authority (EDTOPTAUT)
Delete ALC Menu Option (DLTALCOPT)
Run ALC Menu Option (RUNALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)
The Move Menu Options (MOVALCOPT) command is used to move a block of menu options to another location on the same menu.
You can access this command by any of the following methods:
·
Use the GO
command to display the menu containing the option to be copied. Key F23 and then select option 11
from
the pop-up list.
Note: If you exit the pop-up maintenance window with option 11
selected, you can move menu options directly by positioning the cursor to the
first option to be moved and keying F22.
· Select option 27 from the ALC menu.
· Prompt the MOVALCOPT command at any command line.
The prompted version of the MOVALCOPT command is shown below.

The parameters for the MOVALCOPT command are described below in the order that they appear on the command prompt.
Specify the qualified name of the menu containing the options to be moved.
The possible values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Enter the range of option numbers to be moved.
The possible low option number values are:
|
1-999 |
Enter an option number from 1 to 999. |
The possible high option number values are:
|
*ONLY |
Only one option is moved. |
| 1-999 | Enter an option number from 1 to 999. |
Enter the beginning option number to which the options should be moved.
The possible values are:
|
*END |
The options are moved to the end of the menu. |
|
1-999 |
Enter an option number from 1 to 999. |
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Create ALC Menu Option (CRTALCOPT)
Copy ALC Menu Option (CPYALCOPT)
Edit Option Authority (EDTOPTAUT)
Delete ALC Menu Option (DLTALCOPT)
Run ALC Menu Option (RUNALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)
The Edit Option Authority (EDTOPTAUT) command is used to control which users may access a menu option.
You can access this command by any of the following methods:
· Use the GO command to display the menu containing the option whose authority you want to change. Key F23 and then select option 6 from the pop-up window.
· Select option 24 from the ALC menu.
· Prompt the EDTOPTAUT command at any command line.
When you fill in the EDTOPTAUT command parameters and press Enter, the Edit Object Authority screen is shown for the menu option. From this display you can easily add and change authorities. A typical Edit Object authority screen is shown in chapter 6.
The prompted version of the EDTOPTAUT command is shown below

The parameters for the EDTOPTAUT command are described below in the order that they appear on the command prompt. Default values are underlined.
Specify the qualified name of the menu containing the option . This is a required parameter.
The possible values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Enter the number of the option for which authority is to be edited. This is a required parameter.
The possible values are:
|
*START |
Authority for the menu startup option will be edited. This option is executed when the menu is first displayed. |
|
*END |
Authority for the ending option will be edited. This option is executed upon exiting the menu. |
|
User-defined function key |
Authority for an option associated with a user-defined function key is edited. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11 and *F13 through *F21. |
|
number |
Enter an option number from 1 to 999. |
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Create ALC Menu Option (CRTALCOPT)
Copy ALC Menu Option (CPYALCOPT)
Delete ALC Menu Option (DLTALCOPT)
Run ALC Menu Option (RUNALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)
The Delete ALC Menu Option (DLTALCOPT) command is used to delete an existing menu option.
You can access this command by any of the following methods:
· Use the GO command to display the menu containing the option to be deleted. Key F23 and then select option 4 from the pop-up window.
· Select option 25 from the ALC menu.
· Prompt the DLTALCOPT command at any command line.
|
Note: |
You cannot delete a menu option that is referred to by
other menu options. You must change
or delete the other options first. |
The prompted version of the DLTALCOPT command is shown below

The parameters for the DLTALCOPT command are described below in the order that they appear on the command prompt. Default values are underlined.
Specify the qualified name of the menu containing the option to be deleted. This is a required parameter.
The possible values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Enter the number of the option to be deleted. This is a required parameter.
The possible values are:
|
*START |
The menu startup option will be deleted. This option is executed when the menu is first displayed. |
|
*END |
The ending option will be deleted. This option is executed upon exiting the menu. |
|
User-defined option |
The option associated with a user-defined function key is deleted. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11 and *F13 through *F21. |
|
number |
Enter an option number from 1 to 999. |
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Create ALC Menu Option (CRTALCOPT)
Copy ALC Menu Option (CPYALCOPT)
Edit Option Authority (EDTOPTAUT)
Run ALC Menu Option (RUNALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)
The Run ALC Menu Option (RUNALCOPT) command can be used to run a menu option without having to display the menu first. When a menu option is run with this command, all relevant attributes are used or checked including:
· Authority.
· Hold status.
· Whether to reference another option.
· Whether to submit the request to batch.
You can access this command by either of the following methods:
· Select option 26 from the ALC menu.
· Prompt the RUNALCOPT command at any command line.
The prompted version of the RUNALCOPT command is shown below.

The parameters for the RUNALCOPT command are described below in the order that they appear on the command prompt. Default values are underlined.
Specify the qualified name of the menu containing the option to be run. This is a required parameter.
The possible values are:
|
name |
The name of an existing ALC menu. |
The possible library values are:
|
*LIBL |
The menu is found using the job library list. |
|
*CURLIB |
The menu is found in the current library |
|
library-name |
The name of the library containing the menu. |
Enter the number of the option to be run. This is a required parameter.
The possible values are:
|
*START |
The menu startup option will be run. This option is usually executed when the menu is first displayed. |
|
*END |
The ending option will be run. This option is usually executed upon exiting the menu. |
|
User-defined function key |
The option associated with a user-defined function key is run. The valid user-defined function keys are *F2, *F6, *F7, *F8, *F11 and *F13 through *F21. |
|
number |
Enter an option number from 1 to 999. |
Related Commands:
The following menu option commands are discussed elsewhere in this chapter:
Create ALC Menu Option (CRTALCOPT)
Copy ALC Menu Option (CPYALCOPT)
Edit Option Authority (EDTOPTAUT)
Delete ALC Menu Option (DLTALCOPT)
For more information about the following command, prompt the command and press F1 to view the on-line help text:
Change ALC Menu Option (CHGALCOPT)