
A New Approach to Creating Full-Screen Menu-Driven Systems for the SAS® System under CMS Jeffrey L. Fowler, Boeing Computer Services ABSTRACT unprotected areas on the screen. Panels actually permit the user to edit a SAS data set. While many approaches have been used in writing full-screen, menu-driven SAS" systems for CMS, SHOWPAN was written for a menu-driven report none proved completely satisfactory for our system in which the users update SAS data sets by purposes. Therefore, we wrote our own Display selecting different menu options and then produce Manager: SHOWPAN. reports by making other selections. This report system, AMARS (Acquisition Management and SHOWPAN is a SAS macro which displays menus Reporting System), displays close to 200 panels and and data entry panels from within SAS using the menus. It is written entirely in SAS, except for the CMS full screen editor, XEDIT. It will work in any REXX execs and XEDIT macros used by SAS 82 or version 5 system running under CMS SHOWPAN to format the screen. The SAS macro Release 4. It was developed in an attempt to correct language is used to selectively include and execute some of the problems encountered with other other SAS code based on menu selections. display managers. These problems are: At the time AMARS was being developed, our • The data set being edited must exist prior to installation was using SAS 82.3. The screens were displaying the screen. being displayed using a SASIFSp® procedure called • Code must be written for each screen to edit PROC FSEDlT. The FSEDIT procedure allows SAS check fields and to validate responses. data sets to be edited on screens which the • Response time is too slow. programmer can fonnat however he desires. • The screens take too much time to design. • Calculations cannot be done without This technique was OK for panels, but extremely returning to SAS. cumbersum for menus. Too much code was being written to build data sets in order to display a menu, This paper describes how SHOWPAN addresses then after returning from the menu, to validate the these and other problems and explains its internal user's selection. What we needed was a way of workings. validating the ",ser's selection WHILE STILL ON THE SCREEN, and returning the selection to SAS in the form of a macro variable. INTRODUCTION Before beginning, two terms that are used MENU DISPLAY frequently in this paper must be defined: MENU and PANEL. A menu is a screen which prompts the Our first attempt at a solution was a very basic user to make a selection. A panel is a screen on version ofSHOWPAN which displayed only menus. which the user is required to enter data in certain The menus were simply CMS files created with XEDIT. SHOWPAN would XEDIT the CMS file, 1296 showing all of the lines except the last one to the (1) How does DOWNLOAD know which fields user. As soon as the user entered a response, his are being displayed on the panel so it can input was compared to the range of permissable download them from the SAS data set? responses contained in the last line of the file. If a (2) How does DISPLAY know where on the panel match was found, SHOWPAN returned control to these fields are shown? the SAS program, passing it the item selected in the program stack. Otherwise, an error message was The answer to both these questions is in the way the displayed and the user had to reenter his selection. panels are designed. Figure 2 shows a sample Figure 1 shows a sample menu as might be panel, illustrating the syntax we decided was the displayed with our current version of SHOWPAN. easiest to use. Briefly, each panel is divided into It is very similar to the earliest prototypes. three sections. The first, called the Panel section, contains the body of the panel. That is, the part This menu-display system worked so well and saved seen by the user. This section can contain both so much time, both in coding and in response time, constant information, such as column headers or that Iwas asked to determine the feasibility of instructions; and variable information, which are displaying data entry panels using the same the values being edited on the SAS data set. The technique. Following is my solution. variable fields are identified by "@". These are the only fields, other than the command line, where the user is permitted to type. These fields can be PANEL DISPLAY reached by using the keyboard tab keys. SHOWP AN panels essentially let users XEDIT SAS The Panel section must start with the keyword data sets. It first invokes a CMS REXX exec -­ PANELNAME and end with ENDPANEL. A name DOWNLOAD -- which looks at the panel about to be to the panel may be supplied following the displayed and determines which fields from the SAS PANELNAME statement. This name will be data set are being displayed on this screen. displayed in the upper right corner of the panel at DOWNLOAD then creates a SAS macro to display time. Basically, SHOWPAN displays every download these fields from the SAS data set to a flat line between PANELNAME and ENDPANEL on CMS file, and returns control to SHOWPAN. the terminal screen, using the XEDIT SET SHOWPAN executes the macro, creating the CMS RESERVED command. The "@" fields are the only file. The panel is then displayed with XEDIT, under places on the screen, other than the command line, control of a REXX XEDIT macro called DISPLAY where the user is permitted to type. These fields which reads in the flat CMS file and displays each appear as underscores at display time. fields in its proper place on the screen. The input fields (where the "@" are) are created by When the user is finished entering or modifying using control characters in the SET RESERVED data on the panel, the process is reversed. command. These control characters are used to tell DISPLAY XEDIT writes another SAS macro to read XEDITthat: in the flat CMS file as input and (re)create the original SAS data set. Control then returns to • The following field is unprotected, ie: it can SHOWPAN which executes the macro, rebuilding be typed over. the SAS data set. • The following field is protected. • The following field is to be displayed in one of Two immediate questions come to mind about this 8 colors. process: • The following field is to have extended highlighting. It can be made to blink, to be 1297 underligned, to be displayed in reverse (alphanumeric, convert to upper case); N viedeo, and so on. (numeric, no decimal); Nx (numeric, round to • The following field is to be displayed x decimal places). SHOWPAN issues an highlighted (high intensity). error message when the user tries to enter an • The following field is to be displayed not alpha in a numeric field and vice-versa. It highlighted (nonnal intensity). automatically converts the case if required • The following field is invisible. and rounds any number entered to the desired number of decimal places. Infonnation about these commands can be obtained • Field Attribute. Pennissable values: N (non­ from the IBM System Product Editor Command and protected); P (protected); I (invisible). If the Macro Reference. field is protected, the user is unable to alter its contents (the cursor will not even go SHOWPAN determines the position of the "@" there). If non-protected, the user may alter fields and inserts the proper control characters to its contents. If invisible, it is non-protected protect or unprotect each field on the screen. but anything being typed in is not displayed. Numbers are right-justified prior to display. This is sometimes desired for clssified Alphanumeric fields are left exactly where they are information such as passwords. typed, so as to preserve leading blanks. • Permissable Values. SHOWPAN will not allow the user to enter any value in this field The second section, called the Field Definitions other than that specified. These values may section, is the section which describes all the be expressed as a range, ttA" - "Z"; as one or variable fields being displayed on the panel. The more explicit values, "A''', lIB", tIC"; or, to fields must be described in the order in which they allow anything to be entered in this field, as appear on the screen, going from left to right and an asterisk. This field must be enclosed in top to bottom. In this section, the field parenthesis. Alpha values must be specified characteristics are established. Fields can be between quotes, either single or double. required/not required, protected/not protected, Numeric values must not be enclosed in numeric/alphanumeric. You may also specify quotes. In this case, the only value the user pennissable values for the field in this section. The may enter for field TEAM is REDSKINS. Field Definitions section starts with the word FIELDDEF and ends with ENDDEF. The third section, which is optional, is called the Paneliogic section. This section lets the Examine the first field definition in figure 2. The programmer do calculations on the screen without definition is divided into 5 parts: returning to SAS. It starts with the word PANELLOGIC and ends with the word • SAS Variable Name. This field contsins the ENDLOGIC. It must be written in REXX. It is name of the variable as it is identified on the executed by SHOWPAN when the user tries to SAS data set being edited, in this case leave the screen. In this example, the TEAM. PANELLOGIC section calculates the winning • RequiredINot Required.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-