Using REXX to Build a Front-End User Interface Han-Li Lee, United Illuminating Company
Total Page:16
File Type:pdf, Size:1020Kb
220 Host Operating Systems Using REXX to Build a Front-end User Interface Han-li Lee, United Illuminating Company present a problem fclo those who do not have any Abstract knowledge or training in SAS language. A user This paper presents the UISSP (UI Social Suppon friendly system is thus required. Since back in early Programs) System, a menu-driven reporting system 1986 UI had not installed SAS/AF yet, the author using IBM's REXX (Restructured EXtended eXecu then decided to use REXX to build a user-friendly tor) language, base SAS e, and SAS/FSP e (SAS front-end interface. UISSP system, to allow the user version 5.18 under CMS operating system) for the to enter the data and run reports easily. United lliuminating Company, an electric utility company located in New Haven, Connecticut. The Running the UISSP System System uses the REXX to write a front-end user REXX is a general pwpose, high-level language. interface to the SAS System. It creates new files, This interface program is written in a REXX lan updates existing files, and produces reports. This guage EXEC, with a filename UISSP and a filetype paper shows the techniques used for building such a EXEC. It contains CP and CMS commands. REXX user-friendly reporting system. It will also compare programs are executed by an interpreter without fiJ'St the use of REXX and SAS/AF ® in building menu being translated into another form. This program is driven systems. written under the host system CMS. To stan running the system, the user just types a word "uissp," the Background filename of the EXEC, at the command line. The One of the United lliurninating (UI) Company's Cor UISSP EXEC is then invoked. The attached Appen porate objectives is to be a good citizen in the com dix of this paper shows an example of running the munities the Company serves. This objective was system by using certain options. Due to the limita established in 1986 and has been kept since. To tion of the space for this paper, the screens are con achieve this objective, the Company is committed to densed, and the output listings are omitted. Below assuming an appropriate share of the responsibility are the basic coding techniques used for building for the communities' growth and well-being and these screens. Four different techniques for prepar encouraging employees of the Company to partici ing the reports are also presented. pate in all types of civic activities. Tips and Techniques The Company provides three type of services: 1. To create an EXEC flle in REXX, the first line has volunteerism, in-kind contributions, and cash contri to be a comment. butions. To document these services, a reporting e.g.:/* comment */ system was needed. This project has been directed byMr.AlbertHarary, VicePresidentofManagement 2. To build a screen use: say " text " Services Department and coordinated by Mr. Robert Buley, Manager of Financial Accounting andRe e.g: see Appendix Screen 1. porting. The author has been assigned to build such say"- ------------------- a system. Since SAS has the capability and flexibil ity for creating user specified reports, it was selected say "I Select an ilem: 1•• as the language for the system. ~, I" say "I 1. Crate a new data set only 1•• In the beginning, SASIFSP was used to build a screen ~ "I 2. Update an existing data set only"" for entering and updating the data. By using base say ••1 3. Produce a report 1•• SAS, four reports were devised for the three types of ~, services respectively and a summary report for com r paring the three types of services. And, these four say "I Enter selection (type 1 -3, or QQ to exit) I"' reports provide the options to produce different, by say" --------------------------·· organization or town, and by quarterly or up-to-date, reports. To use these options, the changes have to be made each time before running the system. This will NESUG '90 Proceedings Host Operating Systems 221 a. use CMS command EXECIO with options 3. To clear the screen each time before the designed FINis and STring xxx... to create a SAS pro screen shows up, use: clrscm gram for repon 1, for example: execio 1 diskw 1rep 1 sas a f 80 "(string" 4. Useful subroutines: 'OYI'IONS DQUOTE NOTEXT82;' a. ~ tum off ems error display */ execio 1 diskw rep1 sas a 2 f80 "(string" 'DATA A; • execio cmsoff: 1 diskw 3repl sas a f 80 "(string" ' SET SSP.' name2';' signal off error set cmstype ht execio 1 diskw rep 1 sas a 33 f 80 "(fmis siring" 'nm;' return b. use CMS command EXECIO with options b. /* tum on ems error display */ FINis and STEm xxxn... to create a SAS pro gram for repon 2, for example: cmson: set cmstype n Line.= signal on error Line.l="OYI'IONS DQUOTE NOTEXT82;" return Line.2="DATEA:" Line.3='" SET SSP." namel";" c. ~ check answer for escape*/ get_answer: Line.33="H: PUT @51 'THE UNITED ILLUM CO'f' parse UPPER pull answer Line.36=" @55 'QUARTER ENDED" month year'" If' if answer= 'HX' ] answer='QQ' then exit Line.47="RUN;" return execio 47 diskw rep2 sas a 1 f 80 "(fmis stem LINE." WARNING: Be sure to erase the SAS J!IOgrams, 5. Use the SELECT instruction, e.g.: REPI SAS and REP2 SAS, before creating items a or b above to avoid stacking over to !he old SAS program. SELEcr WHEN filename = 'REPl' then call report_1 c. make a copy WHEN filename = 'REP2' then call report_2 of the program rep3 sspsas and use CMS command EXECIO with options OTHERWISE NOP STring xxx to change the existing SAS program for report END 3, for example: 6. Four different ways to produce the reports. The •copyfue rep3 sspsas * rep3 sas a (replace • first two SAS programs, REPl SAS AandREP2 SAS A, are produced within the REXX EXEC, while the other two are produced externally and saved under execio 1 diskw rep3 9sas a f 80 "(siring" different ftletype and fllemode as REP3 SSPSAS • ' BY 'orgtown ';' and REP4 SSPSAS *. d make a copy of the program rep4 sspsas and use instruction QUEUE in REXX to edit the repon program, for example: NESUG '90 Proceedings 222 Host Operating Systems 'copyflle REP4 SSPSAS • REP4 SAS A(replace' QUEUE 'COMMAND TOP' References QUEUE 'COMMAND CHANGE' 'I' '.' IBM VM!SP System Product Interpreter Reference, 'NEW''/' '.'namel '/* •• SC24-5239-l QUEUE 'COMMAND FILE' 'XEDIT REP4 SAS a (noprofile)' IBM VMISP System Prodouct Interpreter User's Guide, SC24-5238 REXX vs. SAS/AF IBM VMISP CMS Command and Macro Reference, SC19-6209-3 This UISSP system was built before the SAS/AF was installed at UI. SAS/AF together with base SAS is IBM VM!SP CMS User's Guide, SC19-6210-3 an application facility for creating a user -friendly front end to business applications, and it also is a great training tool. Both REXX and SAS/AF are easy to learn. However, it is also easy to make mistakes. The screens that are shown in the attached Appendix can be created in SAS/AFwith MENU and SAS, SAS/FSP and SAS/AF are registered trade PROGRAM screens. And the built-in facilities in SAS/AFprovidemuchnicerlookingscreensandalso markS of SAS Institute Inc. Cary NC USA make it easier to create a user-friendly front end to other products in the SAS System. Conclusion This paper presents an example of how to build a The author may be contacted at user-friendly interface to the SAS system in REXX. United illuminating It is not the only, much less the best, way to accom Company plish the results. However, it does show some differ 80 Temple Street ent uses of the techniques. The techniques employed New Haven, CT 06506 in this paper can be useful in other applications. Although we now have powerful tools like SAS/AF, Telephone: (203)787-7904 especially in version 6, to make the work easier, a REXX EXEC remains useful in many cases, and it does offer an alternative as a powerful interface building tool. NESUG '90 Proceedings Host Operating Systems 223 APPENDIX RtOOIDIG THE UISSP SYSTEM Screen 1 Select an item: 1. create a new data set 2. Update an existing data set 3. Produce a report Enter selection (type number- l 3, or type QQ to exit) 2 (user-supplied value) Screen 2 Please give any desired l-6 character filename. (e.g.: Enter name, name is any desired filename, l-6 char, the file type is always SSP) bbrevl (user-supplied value) Screen 3 If you are goinq to alter the data and save it under a new data set, please qive a l-6 character new filename. Otherwise, just press the ENTER. You may update the data when the screen shows up. Please waite!!! bbrev2 (user-supplied value) Screen 4 Date: 1986 (ddmonyy) Activity: V (C)ash, (I)n-kind, (V)olunteer UI Program: Subscription: _ (do not enter) Organization: ANSONIA FIRE DEPT. KPA Code: Street Number: street: Town: ANSONIA State: CT Zip: type: 4 (Number l through 13) Contact: Telephone: 787-7567 Service Provided: FIREFIGHTER Last Name: BACLAWSKI First Name: EDWARD Length of loan from: ( ddmonyy) To: (ddmonyy) Total Hours: PUrpose: Amount or Estimated Value: (9,999,999.99) Follow up Date: (ddmonyy) PFlaHelp PF2=Return to SAS PF3=End PF5=Repeat PF6=Dup PF7=Backward PF8=Forward PF9=Add New Screen PFlO=Left PF1l=Right PF12=Command Line Screen 5 Would you like to produce a report? Please answer (y or n) y (user-supplied value) NESUG '90 Proceedings 224 Host Operating Systems Screen 6 Select a REPORT you would like to produce:, 1.