Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4

Restriction: You must use at least one MENU statement followed by at least one ITEM statement.

Tip: Supports RUN group processing

Reminder: You can also use appropriate global statements with this procedure. See Chapter 2, Fundamental Concepts for Using Base SAS Procedures, on page 15 for a list.

See: PMENU Procedure in the documentation for your operating environment.

PROC PMENU <CATALOG=< libref .> catalog >

To do this

Use this statement

Define choices a user can make in a dialog box

CHECKBOX

Describe a dialog box that is associated with an item in a pull-down menu

DIALOG

Identify an item to be listed in a menu bar or in a pull-down menu

ITEM

Name the catalog entry or define a pull-down menu

MENU

List and define mutually exclusive choices within a dialog box

RADIOBOX and RBUTTON

Define a command that is submitted when an item is selected

SELECTION

Draw a line between items in a pull-down menu

SEPARATOR

Define a common submenu associated with an item

SUBMENU

Specify text and the input fields for a dialog box

TEXT

PROC PMENU Statement

Invokes the PMENU procedure and specifies where to store all PMENU catalog entries that are created in the PROC PMENU step.

PROC PMENU <CATALOG=< libref .> catalog >

Options

CATALOG=< libref .> catalog

DESC entry-description

CHECKBOX Statement

Defines choices that a user can make within a dialog box.

Restriction: Must be used after a DIALOG statement.

CHECKBOX <ON> #line @column

Required Arguments

column

line

text-for-selection

Options

COLOR= color

ON

SUBSTITUTE= text-for-substitution

Check Boxes in a Dialog Box

Each CHECKBOX statement defines a single item that the user can select independent of other selections. That is, if you define five choices with five CHECKBOX statements, then the user can select any combination of these choices. When the user selects choices, the text-for-selection values that are associated with the selections are inserted into the command string of the previous DIALOG statement at field locations prefixed by an ampersand (&).

DIALOG Statement

Describes a dialog box that is associated with an item on a pull-down menu.

Restriction: Must be followed by at least one TEXT statement.

Featured in: Example 2 on page 701, Example 3 on page 703, and Example 4 on page 710

DIALOG dialog-box command-string

Required Arguments

command-string

dialog-box

field-number-specification

Details

Dialog boxes have two or more buttons , such as OK and Cancel, automatically built into the box. [*] A button causes an action to occur.

ITEM Statement

Identifies an item to be listed in a menu bar or in a pull-down menu.

Featured in: Example 1 on page 698

ITEM command < option(s) >< action-options >;

ITEM menu-item < option(s) >< action-options >;

To do this

Use this option

Specify the action for the item

 
 

Associate the item with a dialog box

DIALOG=

 

Associate the item with a pull-down menu

MENU=

 

Associate the item with a command

SELECTION=

 

Associate the item with a common submenu

SUBMENU=

Specify help text for an item

HELP=

Define a key that can be used instead of the pull-down menu

ACCELERATE=

Indicate that the item is not an active choice in the window

GRAY

Provide an ID number for an item

ID=

Define a single character that can select the item

MNEMONIC=

Place a check box or a radio button next to an item

STATE=

Required Arguments

command

menu-item

Options

ACCELERATE= name-of-key

action-option

GRAY

HELP= help-text

ID= integer

MNEMONIC= character

STATE=CHECKRADIO

Defining Items on the Menu Bar

You must use ITEM statements to name all the items that appear in a menu bar. You also use the ITEM statement to name the items that appear in any pull-down menus . The items that you specify in the ITEM statement can be commands that are issued when the user selects the item, or they can be descriptions of other actions that are performed by associated DIA0LOG, MENU, SELECTION, or SUBMENU statements.

All ITEM statements for a menu must be placed immediately after the MENU statement and before any DIALOG, SELECTION, SUBMENU, or other MENU statements. In some operating environments, you can insert SEPARATOR statements between ITEM statements to produce lines separating groups of items in a pull-down menu. See SEPARATOR Statement on page 693 for more information.

Note: If you specify a menu bar that is too long for the window, then it might be truncated or wrapped to multiple lines.

MENU Statement

Names the catalog entry that stores the menus or defines a pull-down menu.

Featured in: Example 1 on page 698

MENU menu-bar ;

MENU pull-down-menu ;

Required Arguments

One of the following arguments is required:

menu-bar

pull-down-menu

Defining Pull-Down Menus

When used to define a pull-down menu, the MENU statement must follow an ITEM statement that specifies the MENU= option. Both the ITEM statement and the MENU statement for the pull-down menu must be in the same RUN group as the MENU statement that defines the menu bar for the PMENU catalog entry.

For both menu bars and pull-down menus, follow the MENU statement with ITEM statements that define each of the items that appear on the menu. Group all ITEM statements for a menu together. For example, the following PROC PMENU step creates one catalog entry, WINDOWS, which produces a menu bar with two items, Primary windows and Other windows . When you select one of these items, a pull-down menu is displayed.

libname proclib ' SAS-data-library '; proc pmenu cat=proclib.mycat; /* create catalog entry */ menu windows; item 'Primary windows' menu=prime; item 'Other windows' menu=other; /* create first pull-down menu */ menu prime; item output; item manager; item log; item pgm; /* create second pull-down menu */ menu other; item keys; item help; item pmenu; item bye; /* end of run group */ run;

The following figure shows the resulting menu selections.

Figure 34.3: Pull-Down Menu

RADIOBOX Statement

Defines a box that contains mutually exclusive choices within a dialog box.

Restriction: Must be used after a DIALOG statement.

Restriction: Must be followed by one or more RBUTTON statements.

Featured in: Example 3 on page 703

RADIOBOX DEFAULT= button-number ;

Required Arguments

DEFAULT= button-number

Details

The RADIOBOX statement indicates the beginning of a list of selections. Immediately after the RADIOBOX statement, you must list an RBUTTON statement for each of the selections the user can make. When the user makes a choice, the text value that is associated with the selection is inserted into the command string of the previous DIALOG statement at field locations prefixed by a percent sign (%).

RBUTTON Statement

Lists mutually exclusive choices within a dialog box.

Restriction: Must be used after a RADIOBOX statement.

Featured in: Example 3 on page 703

RBUTTON <NONE> #line @column

Required Arguments

column

line

text-for-selection

Note: Be careful not to overlap columns and lines when placing text and radio buttons; if you overlap text and buttons, you will get an error message. Also, specify space between other text and a radio button.

Options

COLOR= color

NONE

SUBSTITUTE= text-for-substitution

SELECTION Statement

Defines a command that is submitted when an item is selected.

Restriction: Must be used after an ITEM statement

Featured in: Example 1 on page 698 and Example 4 on page 710

SELECTION selection command-string ;

Required Arguments

selection

command-string

Details

You define the name of the item in the ITEM statement and specify the SELECTION= option to associate the item with a subsequent SELECTION statement. The SELECTION statement then defines the actual command that is submitted when the user chooses the item in the menu bar or pull-down menu.

You are likely to use the SELECTION statement to define a command string. You create a simple alias by using the ITEM statement, which invokes a longer command string that is defined in the SELECTION statement. For example, you could include an item in the menu bar that invokes a WINDOW statement to enable data entry. The actual commands that are processed when the user selects this item are the commands to include and submit the application.

Note: If you are using PROC PMENU to issue any command that is valid only in the PROGRAM EDITOR window (such as the INCLUDE command), then you must have the windowing environment running, and you must return control to the PROGRAM EDITOR window.

SEPARATOR Statement

Draws a line between items on a pull-down menu.

Restriction: Must be used after an ITEM statement.

Restriction: Not available in all operating environments.

SEPARATOR;

SUBMENU Statement

Specifies the SAS file that contains a common submenu associated with an item.

Featured in: Example 1 on page 698

SUBMENU submenu-name SAS-file ;

Required Arguments

submenu-name

SAS-file

TEXT Statement

Specifies text and the input fields for a dialog box.

Restriction: Can be used only after a DIALOG statement.

Featured in: Example 2 on page 701

TEXT # line @ column field-description

Required Arguments

column

field-description

line

Options

ATTR= attribute

COLOR= color

[*] The actual names of the buttons vary in different windowing environments.

Категории