IS MUMPS FOR YOU? by Melvin Goldstein In this article you will learn about a computer language called MUMPS. It does not contain the details of the MUMPS language, rather does it examine the question: "IS MUMPS FOR YOU?" in such a manner that perhaps you will explore the references given at the end of this article and become a MUMPS user. (Q) - What is the Standard MUMPS computer language? (A) - The standard MUMPS computer language is a general purpose high level language (high level meaning more people friendly) designed to put information into the computer and retrieve infor- mation from the computer in a communicative dialogue with no delays. It's many features make it ideal for text processing, communications and business applications where large complex records must be transferred, designed, constructed and main- tained. (Q) - What does MUMPS stand for? (A) - MUMPS was first developed at the Massachusetts General Hospital in Boston. Its name stands for Massachusetts General Hospital Utility Multi-Programming System. Although the language started in a hospital, the majority of its users are applying MUMPS to business. (Q) - Why should you consider using MUMPS? (A) - MUMPS is simple to learn and extremely powerful to use. MUMPS gives the novice the tool to do a professional job on formidable programming applications. Additionally, MUMPS gives the professional programmer a full set of software tools designed for real life tasks and problems he consistently encounters in the production and maintenance of application software. MUMPS has three very important attributes: 1) It is programmer productive. Applications programs can be written in one-half to one-fifth the time required with other languages. The more complex the program the greater the productivity. 2) Programs are transportable. Applications code written on Micros (small computers) will run on Mainframes (large computers). Likewise, we can demonstrate Main-frame soft- ware running on Micros. Develop and debug software at home on your Micro, then move it to your Main-frame at the office and it works! This also means that you are not bound to a specific vendor's hardware; you may choose the most cost effective solution. 3) It lowers the threshold of dedication and or aptitude necessary to write complex applications. People who may not become productive in other languages will find MUMPS a welcome alternative. (Q) - What does it mean that MUMPS is an AMERICAN NATIONAL STANDARD INSTITUTE approved standard language? (A) - All implementations of STANDARD MUMPS rigidly adhere to the MUMPS language standard using the same commands, functions, and operators; therefore, programs can be transported between dif- ferent computers running STANDARD MUMPS. This means that the user is not restricted to a single machine or software producer. If a system grows it can be moved to a larger computer easily. Sharing of applications software between users with different computers is possible. Your applications software need no longer live or die with the machine on which you initially wrote and ran the program. (Q) - Who else is using MUMPS? (A) - Thousands of business organizations throughout the world are using MUMPS. Users are concentrated in the United States, Europe, United Kingdom, Japan, Asia, and South America. There are formal User Groups in the United States, United Kingdom, Europe, Japan, and Brazil. The MUG, the MUMPS User Group in the U.S., has an annual meeting (with over 5000 participants) where technical papers and tutorials are presented. The MUG has had a dramatic growth in the past three years evidencing MUMPS's poten- tial for becoming a popular mainstay. The MUG publishes a Quar- terly Magazine and various texts about MUMPS. (Q) - If MUMPS is so good why has it had so little press? (A) - Several reasons: 1) MUMPS was designed so it could run with good response times on low resource hardware in a real-time environment. This was contrary to the big hardware suppliers interest. Fewer resources implied lower dollars, and transportability was contrary to captive sale of hardware, so MUMPS had to wait until the smaller companies offered low priced micro- computer systems before there was a general availability. Languages become popular when they get the support of the major hardware suppliers. MUMPS' day is soon coming: major hardware suppliers are beginning to support the language as the U.S. Government installs MUMPS systems as its required data base/application programming language in all Veterans Administration Hospitals. 2) MUMPS has not been taught in many colleges -- this is changing. 3) System houses and corporate data processing departments who use MUMPS have little incentive to advertise their lower production costs. 4) Few books have been published about MUMPS (perhaps for the reasons above) -- this too is changing. MUMPS grew in spite of the lack of promotion or commercial push and did so on its own inherent merits. (Q) - What makes MUMPS so good? (A) - MUMPS has many features that transparently perform house- keeping functions which other languages require explicitly. Housekeeping chores not only burden the programmer but are a constant source of errors. Literature abounds with claims of rates of 10 lines of debugged code per man-day. Not very impressive and many programmers would disagree. However, since most software comes in late and over budget, one must give some credence to the literature. MUMPS programs need less code per application which means fewer bugs and greater productivity. (Q) - Other than the house keeping chores what other features make MUMPS so good and reduce the amount of code per application? (A) - All variables in MUMPS may be thought of as strings and the interpreter is smart enough to know how each string is to be used. You do not have to make declarations as to the type or form of your data -- MUMPS knows when it must deal with the vari- ables and/or data as integers, alphas, numerics, or floating point types. There are no dimension declarations in MUMPS for arrays. You do not have to declare the size of the array to reserve space for all potential values of the subscript. MUMPS stores only the values as they are dynamically defined. This type of array structure is known as a SPARSE ARRAY (as opposed to other systems which use DENSE ARRAYS). If you have recorded a value of S(I) for I=1 and for I=100 only those values are stored in the sys- tem. In DENSE ARRAYS, space would have to be reserved for all intermediate values (2-99) and thus use significantly more stor- age space. MUMPS, being string orientated, allows array subscripts to be alphas as well as numerics. Variable names and line labels (line labels are optional) can be descriptive by the use of strings. Example for Employee file: ^EMP(EMPNO,"NAM")= ... ^EMP(EMPNO,"AGE")= ... ^EMP(EMPNO,"SSNO")= ...........etc. Easier to read, debug, and maintain. MUMPS has a uniquely feature, PATTERN MATCHING, which compares a string with a desired pattern. This powerful feature allows for the filtering of input data for conformity so that errors can readily be detected and immediately re-prompted at their source. To test for a valid social security number you could use: IF SSNO?3N1"-"2N1"-"4N MUMPS includes an extensive set of powerful string handling features. Searches, edits, extractions, and substrings are easily handled. MUMPS has been termed as a string handling language. MUMPS can operate routinely with variable length strings without the overhead burden (extensive program modifica- tion) required in most other languages. If ZIP Codes changed from 5 numerics to 9 numerics, the only changes you would have to make in your MUMPS routines would be in the input filtering code (if you employed PATTERN MATCHING to trap errors), and to make sure that enough space for the additional characters existed on the output forms. If one looks at a MUMPS program it will be evident that there are multiple instructions per line. It allows for a more readable grouping of logic somewhat as literature uses a sentence to express an idea. Some of the functions in MUMPS encourage this long line type structure and it has been argued that editing such code may be somewhat easier. MUMPS has also been termed a DATA BASE LANGUAGE and it earns this distinction because the user is freed from much of the overhead involved in storing and retrieving data that plagues other lan- guages. Want to store or retrieve data from disk? In MUMPS just put a caret "^" preceding the variable and MUMPS performs all the necessary chores of storage and retrieval automatically. With MUMPS, sort and merge routines are no longer needed since the data is stored transparently in a hierarchical base as it is dynamically created. Two functions in MUMPS, $ORDER and $DATA, allow one to efficiently and systematically retrieve and test for data in the hierarchical base. MUMPS allows the programmer to be free of details necessary to construct the physical file struc- ture so that he or she can concentrate on the a logical file generation suited to the application. MUMPS has a powerful feature called indirection, that is normally only found in assembly code. Indirection uses the value of a variable or command argument as the address to retrieve another variable or command argument. Additionally, MUMPS allows a string to be executed as if it were code. This allows the same segment of MUMPS code to be executed with dynamically changing data yielding differing results. The advantage of this technique is that proven debugged code can utilize different text to per- form a variety applications. Example: write code for a screen prompter to input data, filter input, re-prompt for errors, and finally store the data in a file. Solution: Write the code using indirection then design a table of strings unique to the application. If you need to write new screen prompter applica- tion just build a new application table for your pre-written debugged code. Indirection can be nested allowing even greater flexibility. MUMPS has many of the features found in other languages: arith- metic and Boolean operators, output formatting, looping, subrou- tines, conditionals, etc. Additionally MUMPS has unique features that allow the user access to time of day and date and to associ- ate timing constraints with many operations. These features are invaluable for testing terminal malfunctions, prompting users in a time critical dialogue, automating unattended procedures, and a host of other considerations. (Q) - Can you cite some specific examples of your above claims for MUMPS. (A) - Perhaps the best way to get the flavor of MUMPS (in addi- tion to the references given at the end of this article) is to attend the annual MUG meeting where you can witness papers, tutorials, and demonstrations that can best answer your question I will cite quotes from two references to illustrate the compara- tive power of MUMPS. 1. From "A case for Mumps" by Casimiro Alonso in COMPUTERWORLD magazine, January 9, 1984, pages 27-32: "In benchmark tests to determine the systems vendor for a retail- ing application, MUMPS -- perhaps surprisingly -- proved the superior choice for programming language performance." ----------------------------------------------------------------- | | IBM | | 32 Bit | System/38 Data General Honeywell Nixdorf | | Systems | Model 5 MV/60000 6/92 8890/30 | | | RPG-III Cobol Cobol Cobol | |---------------------------------------------------------------| |Data base | 1 hour, 6 hours 1 hour, 1 hour, | | creation | 50 min. 5 min. 6 min. | |---------------------------------------------------------------| |Long query | 4 min. 4 min., 1 min., 4 min., | | | 30 sec. 25 sec. 1.1 sec. | |---------------------------------------------------------------| |Short query | 1 sec. 1 sec. 1 sec. 1 sec. | |---------------------------------------------------------------| |Data base | | |occupation | 23,403 22,500 14,799 23,831 | |(K bytes) | | |---------------------------------------------------------------| |Lines of | 835 1,150 2,219 3,239 | | code | | ----------------------------------------------------------------- TABLE I (part 1) ------------------------------------------------------------- | 16 Bit | DEC HP 3000 Microdata | | Systems | PDP-11/44 Reality 2000 | | | MUMPS Fortran Basic | |-----------------------------------------------------------| |Data base | 32 min 3 hour, 48 min | | creation | 30 min | |-----------------------------------------------------------| |Long query | 3min,55sec 2min,30sec 15 min | |(17,000 records)| | |-----------------------------------------------------------| |Short query | <1 sec >2 sec 18 sec | |-----------------------------------------------------------| |Data base | | |occupation | 6,073 23,083 3,000 | |(K bytes) | | |-----------------------------------------------------------| |Lines of | 183 2,684 391 | | code (source) | | ------------------------------------------------------------- TABLE I (part 2) "MUMPS performed much better than the other languages on almost every comparison run (see TABLE I, parts 1 & 2). On the data base creation MUMPS was from half again as fast to 18 times as fast as the other systems. The MUMPS data base also occupied only one half to one-fourth of the disk space required by others. And MUMPS programming required one-third fewer lines of code. "In summary, in different comparisons on various machines, MUMPS was bested only once. "A more significant fact is that a Digital Equipment Corporation PDP-11/44, running MUMPS, actually out-performed all 16-bit and most 32-bit minis on most of the tests. "This data indicates that a user choosing MUMPS software for interactive data base applications can expect up to five times more power from a given computer. And this power, in turn, will eliminate many of the performance problems encountered by mini- computers in administrative environments. "In addition, the data laid to rest the criticism that the MUMPS "interpreter" approach imposes performance penalties on applica- tions. The results clearly show that MUMPS is not at all slower than other software. Indeed, it offers an incredible performance increase over competitive systems. "For these reasons, we decided to recommend that our client go with a MUMPS applications program." "On this recommendation, we were selected, and our customer ordered three VAX systems as described above. They are now up and running. "Prior to installation, the customer was able to save consider- able development time by assigning three programmers and a system analyst, none with prior MUMPS experience, to develop and test applications on our in-house PDP-11. This development work was possible because no conversion was needed when the applications moved later to the VAX. "The applications development took about one-third the amount of time that had been forecast for the use of other languages. Seven complex applications were developed in a space of about four months. "In addition, the customer got a bonus in disk space savings, which provides growth potential and a future possibility of saving money in disk configuration." 2. From "A linguistic comparison of MUMPS and COBOL" by Thomas Munnecke -- National Computer Conference 1980: "The author once translated a COBOL program into MUMPS. The COBOL program was part of a payroll system which received a batch of time and attendance records and computed the gross and net pays, various leave balances, and the like. The MUMPS version replaced the batch system with on-line data entry and validation, with immediate computations. Thus, the MUMPS version had more work to do. ITEM COBOL MUMPS ---------------------------------------------- Lines of code 3600 300 "IF" statements 460 89 "GOTO" statements 650 43 Total program size 120k 9k The MUMPS version required approximately 8% of the lines of code, 19% of number of conditional checks (even with the added validity checks), 6% of the programming branches, and 8% of the run-time memory. Execution time on a $100,000 MUMPS minicomputer was approximately twice as long as the several million dollar COBOL/IBM 370/158 computer. Exact programing times were hard to estimate, but three weeks were spent on the MUMPS version, while the original COBOL version took an estimated six to nine months." (Q) - What do you see as the future for MUMPS. (A) - The adoption of MUMPS as a standard language by the Amer- ican National Standards Institute (ANSI) requires a deliberate conservative pace for changes in the language. This may be why MUMPS is the only truly transportable language. New additions and changes are proposed by the MUMPS Development Committee (which meets two to three times a year), after long discussion and much debate. Changes accepted by the committee then go through a series of releases and are field tested by vendors which finally, when proven, are recommended for incorporation into the Standard. ANSI then reviews the recommendation for adopting the changes. This procedure insures against ad hoc changes from multiple sources with the great frequency that plagues other languages, all in the name of enhancements. MUMPS is in fact not a static language. There are a number of "A" and "B" so called releases presently that will ultimately be incorporated into the standard and the Development Committee continues to insure the deliberate on-going evolution. (Q) - What can be said about MUMPS for the average programmer? (A) - MUMPS can be learned with the same ease that one learns BASIC. You don't need to be a super brain to program in MUMPS. You don't need to be a computer genius to write complex applica- tions in MUMPS. MUMPS provides the tools for all programmers to generate sophisticated, useful applications with a minimum of effort. REFERENCES: 1. STANDARD MUMPS POCKET GUIDE (Joel Achtenberg) 2. ANSI MUMPS PROGRAMMERS' REFERENCE GUIDE (MUMPS Users' Group, 1981) 3. COMPUTER PROGRAMMING IN STANDARD MUMPS: Second Edition (1984) (Arthur F. Krieg, David H. Miller, and Gregory Bressler) 4. MUMPS PRIMER REVISED (1983) (R. F. Walters, J. Bowie, and J. C. Wilcox) 5. A COOKBOOK OF MUMPS (1985) (David B. Brown and Donald H. Glaeser, D.Sc.) 6. THE MUG QUARTERLY (MUMPS Users' Group) The above publications may be obtained through the: MUMPS USERS' GROUP 4321 HARTWICK ROAD, SUITE 510 COLLEGE PARK, MD 20740 7. COMP COMPUTING STANDARD MUMPS (1985) (David Brown, Gladys Brown, and Melvin Goldstein) 8. COMP COMPUTING STANDARD MUMPS SYSTEM/APPLICATIONS (Comes with MUMPS tutorial and MUMPS operating system for Micros: CCSM for Macs: MacMUMPS) available from: M-GLOBAL PHONES 1601 Westheimer, Suite 201 within Texas: (713) 529-5276 Houston, Texas 77006 out-of-state: (800) 257-8052