Features: |
DIALOG statement SELECTION statement |
Other features: |
FILENAME statement |
libname proclib
'SAS-data-library';
filename de 'external-file'; filename prt 'external-file';
proc pmenu catalog=proclib.menus;
menu select;
item 'File' menu=f; item 'Data_Entry' menu=deptsde; item 'Print_Report' menu=deptsprt;
menu f; item 'End this window' selection=endwdw; item 'End this SAS session' selection=endsas; selection endwdw 'end'; selection endsas 'bye';
menu deptsde; item 'For Dept01' selection=de1; item 'For Dept02' selection=de2; item 'Other Departments' dialog=deother;
selection de1 'end;pgm;include de;change xx 01;submit'; selection de2 'end;pgm;include de;change xx 02;submit';
dialog deother 'end;pgm;include de;c deptxx @1;submit'; text #1 @1 'Enter department name'; text #2 @3 'in the form DEPT99:'; text #2 @25 len=7;
menu deptsprt; item 'For Dept01' selection=prt1; item 'For Dept02' selection=prt2; item 'Other Departments' dialog=prother;
selection prt1 'end;pgm;include prt;change xx 01 all;submit'; selection prt2 'end;pgm;include prt;change xx 02 all;submit';
dialog prother 'end;pgm;include prt;c deptxx @1 all;submit'; text #1 @1 'Enter department name'; text #2 @3 'in the form DEPT99:'; text #2 @25 len=7;
run;
menu entrdata; item 'File' menu=f; menu f; item 'End this window' selection=endwdw; item 'End this SAS session' selection=endsas; selection endwdw 'end'; selection endsas 'bye'; run; quit;
menu f; item 'End this window' selection=endwdw; item 'End this SAS session' selection=endsas; selection endwdw 'end'; selection endsas 'bye';
menu deptsde; item 'For Dept01' selection=de1; item 'For Dept02' selection=de2; item 'Other Departments' dialog=deother;
selection de1 'end;pgm;include de;change xx 01;submit'; selection de2 'end;pgm;include de;change xx 02;submit';
deptxx
in the SAS program
that is included. The first two TEXT statements specify text that
appears in the dialog box. The third TEXT statement specifies an input
field. The name that is entered in this field is substituted for the
@1 in the DIALOG statement.dialog deother 'end;pgm;include de;c deptxx @1;submit'; text #1 @1 'Enter department name'; text #2 @3 'in the form DEPT99:'; text #2 @25 len=7;
menu deptsprt; item 'For Dept01' selection=prt1; item 'For Dept02' selection=prt2; item 'Other Departments' dialog=prother;
selection prt1 'end;pgm;include prt;change xx 01 all;submit'; selection prt2 'end;pgm;include prt;change xx 02 all;submit';
deptxx
in the SAS program
that is included. The first two TEXT statements specify text that
appears in the dialog box. The third TEXT statement specifies an input
field. The name entered in this field is substituted for the @1 in
the DIALOG statement.dialog prother 'end;pgm;include prt;c deptxx @1 all;submit'; text #1 @1 'Enter department name'; text #2 @3 'in the form DEPT99:'; text #2 @25 len=7;
data _null_; window hrselect menu=proclib.menus.select #4 @10 'This application allows you to' #6 @13 '- Enter human resources data for' #7 @15 'one department at a time.' #9 @13 '- Print reports on human resources data for' #10 @15 'one department at a time.' #12 @13 '- End the application and return to the PGM window.' #14 @13 '- Exit from the SAS System.' #19 @10 'You must have the menus turned on.';
Data_Entry
from
the menu bar in the HRSELECT window, a menu
is displayed. When the user selects one of the listed departments
or chooses to enter a different department, the following statements
are invoked. These statements are stored in the file that is referenced
by the DE fileref.
data proclib.deptxx; window hrdata menu=proclib.menus.entrdata #5 @10 'Employee Number' #8 @10 'Salary' #11 @10 'Employee Name' #5 @31 empno $4. #8 @31 salary 10. #11 @31 name $30. #19 @10 'Press ENTER to add the observation to the data set.';
Other Departments
and
enters DEPT05
, then the DATA statement is
changed by the command string in the DIALOG statement to
Print_Report
from
the menu bar, a menu is displayed. When the user selects one of the
listed departments or chooses to enter a different department, the
following statements are invoked. These statements are stored in the
external file referenced by the PRT fileref.
libname proclib
'SAS-data-library';
proc print data=proclib.deptxx;
title 'Information for deptxx';
run;