Previous Page | Next Page

The PMENU Procedure

Example 2: Collecting User Input in a Dialog Box


Procedure features:

DIALOG statement

TEXT statement option:

LEN=


This example adds a dialog box to the menus created in Building a Menu Bar for an FSEDIT Application. The dialog box enables the user to use a WHERE clause to subset the SAS data set.

Tasks include


Program

 Note about code
libname proclib 'SAS-data-library';
 Note about code
proc pmenu catalog=proclib.menucat;
 Note about code
   menu project;
 Note about code
      item 'File' menu=f;
      item 'Edit' menu=e;
      item 'Scroll' menu=s;
      item 'Subset' menu=sub;
      item 'Help' menu=h;
 Note about code
      menu f;
         item 'Goback' selection=g;
         item 'Save';
         selection g 'end';
 Note about code
      menu e;
         item 'Cancel';
         item 'Add';
 Note about code
      menu s;
         item 'Next Obs' selection=n;
         item 'Prev Obs' selection=p;
         item 'Top';
         item 'Bottom';
         selection n 'forward';
         selection p 'backward';
 Note about code
      menu sub;
         item 'Where' dialog=d1;
         item 'Where Clear';
 Note about code
      menu h;
         item 'Keys';
         item 'About this application' selection=hlp;
         selection hlp 'sethelp proclib.menucat.staffhlp.help;help';
 Note about code
      dialog d1 'where @1';
         text #2 @3 'Enter a valid WHERE clause or UNDO';
         text #4 @3 'WHERE ';
         text #4 @10 len=40;
quit;

Associating a Menu Bar with an FSEDIT Window

The following SETPMENU command associates the customized menu bar with the FSEDIT window.

setpmenu proclib.menucat.project.pmenu;pmenu on

You can also specify the menu bar on the command line in the FSEDIT session or by issuing a CALL EXECCMD command in SAS Component Language (SCL). Refer to SAS Component Language: Reference for complete documentation on SCL.

See Associating a Menu Bar with an FSEDIT Session for other methods of associating the customized menu bar with the FSEDIT window.

 Note about figure

[Where Dialog Box]

Previous Page | Next Page | Top of Page