Chapter Contents


The PMENU Procedure


Procedure Execution
You can define multiple menus by separating their definitions with RUN statements. A group of statements that ends with a RUN statement is called a RUN group. You must completely define a PMENU catalog entry before submitting a RUN statement. You do not have to restart the procedure after a RUN statement.

You must include an initial MENU statement that defines the menu bar, and you must include all ITEM statements and any SELECTION, MENU, SUBMENU, and DIALOG statements as well as statements that are associated with the DIALOG statement within the same RUN group. For example, the following statements define two separate PMENU catalog entries. Both are stored in the same catalog, but each PMENU catalog entry is independent of the other. In the example, both PMENU catalog entries create menu bars that simply list windowing environment commands the user can select and execute:

   libname proclib 'SAS-data-library';

   proc pmenu catalog=proclib.mycat;
      menu menu1;
      item end;
      item bye;

      menu menu2;
      item end;
      item pgm;
      item log;
      item output;

When you submit these statements, you receive a message that says that the PMENU entries have been created. To display one of these menu bars, you must associate the PMENU catalog entry with a window and then activate the window with the menus turned on, as described in Steps for Building and Using PMENU Catalog Entries .

Ending the Procedure

Submit a QUIT, DATA, or new PROC statement to execute any statements that have not executed and end the PMENU procedure. Submit a RUN CANCEL statement to cancel any statements that have not executed and end the PMENU procedure.

Steps for Building and Using PMENU Catalog Entries
In most cases, building and using PMENU entries requires the following steps:

  1. Use PROC PMENU to define the menu bars, pull-down menus and other features that you want. Store the output of PROC PMENU in a SAS catalog.

  2. Define a window using SAS/AF and SAS/FSP Software, or the WINDOW or %WINDOW statement in base SAS software.

  3. Associate the PMENU catalog entry created in step 1 with a window by using one of the following:

  4. Activate the window you have created. Make sure that the menus are turned on.

Templates for Coding PROC PMENU Steps
The following coding templates summarize how to use the statements in the PMENU procedure. Refer to descriptions of the statements for more information:

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.