Concepts: PMENU Procedure


Procedure Execution

Initiating the Procedure

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;  run;     menu menu2;     item end;     item pgm;     item log;     item output;  run; 

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 on page 696.

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:

    • the MENU= option in the WINDOW statement in base SAS software. See Associating a Menu with a Window on page 713.

    • the MENU= option in the %WINDOW statement in the macro facility.

    • the Command Menu field in the GATTR window in PROGRAM entries in SAS/ AF software.

    • the Keys, Pmenu, and Commands window in a FRAME entry in SAS/AF software. See Example 5 on page 716.

    • the PMENU function in SAS/AF and SAS/FSP software.

    • the SETPMENU command in SAS/FSP software. See Example 1 on page 698.

  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:

  • Build a simple menu bar. All items on the menu bar are windowing environment commands:

     proc pmenu;     menu  menu-bar  ;     item  command  ;     ...  more-ITEM-statements  ...  run; 
  • Create a menu bar with an item that produces a pull-down menu:

     proc pmenu;      menu  menu-bar  ;      item  'menu-item'  menu=  pull-down-menu  ;      ...  more-ITEM-statements  ...      menu  pull-down-menu  ;      ...  ITEM-statements-for-pull-down-menu  ...  run; 
  • Create a menu bar with an item that submits a command other than that which appears on the menu bar:

     proc pmenu;     menu  menu-bar  ;     item  'menu-item'  selection=  selection  ;     ...  more-ITEM-statements  ...     selection  selection 'command-string'  ;  run; 
  • Create a menu bar with an item that opens a dialog box, which displays information and requests text input:

     proc pmenu;     menu  menu-bar  ;     item  'menu-item'  menu=  pull-down-menu  ;     ...  more-ITEM-statements  ...     menu  pull-down-menu  ;        item  'menu-item'  dialog=  dialog-box  ;        dialog  dialog-box  '  command  @1';           text #  line  @  column 'text'  ;           text #  line  @  column  LEN=  field-length  ;  run; 
  • Create a menu bar with an item that opens a dialog box, which permits one choice from a list of possible values:

     proc pmenu;     menu  menu-bar  ;     item  'menu-item'  menu=  pull-down-menu  ;     ...  more-ITEM-statements  ...     menu  pull-down-menu  ;        item  'menu-item'  dialog=  dialog-box  ;        dialog  dialog-box  '  command  %1';           text #  line  @  column 'text'  ;        radiobox default=  button-number  ;        rbutton #  line  @  column   'text-for-selection'  ;        ...  more-RBUTTON-statements  ...  run; 
  • Create a menu bar with an item that opens a dialog box, which permits several independent choices:

     proc pmenu;     menu  menu-bar  ;     item  'menu-item'  menu=  pull-down-menu  ;     ...  more-ITEM-statements  ...     menu  pull-down-menu  ;        item  'menu-item'  dialog=  dialog-box  ;        dialog  dialog-box 'command  &1';           text #  line  @  column 'text'  ;           checkbox #  line  @  column 'text'  ;           ...  more-CHECKBOX-statements  ...  run; 



Base SAS 9.1.3 Procedures Guide (Vol. 1)
Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4
ISBN: 1590472047
EAN: 2147483647
Year: 2004
Pages: 260

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net