Printer Friendly

Writing your own accounting programs.

Writing Your Own Accounting Programs

The acquisitions department at Chicago State University needed an accounting program and the coordinator of library student aides needed a personnel records management system. Neither program constitutes a very exotic piece of computer software, but the contemplation of purchasing commercially developed programs brought up the inevitable "Will the program conform to our needs?"

To that last statement should be added "...right out of the box?" The latter piques the Doubting Thomas in all of us, despite the fact that [your state goes here]'s library association journal usually advertises commercial database (serials management, acquisitions, accounting) programs guaranteed "fully compatible" with your library's environment.

It is possible that the World According to GAAP (generally accepted accounting principles) is attainable through off-the-shelf software, but your state (or internal) auditors may have other ideas about the format. To this writer, professed compatibility can be wishful thinking for a program that can carry a price tag of as much as $ 2,500.

The only alternative is to write your own, or, if your budget is robust, to hire someone to write one for you. You can realize several advantages through local authorship, not the least of which is (and especially if the program is a group effort) freedom from wading through user manuals; you've written your own as you develop the program. The other obvious benefit is that you can custom tailor the program to your own specifications, including whatever bells and whistles you like. And conceivably, if the program is generic enough, you could be the one placing the classified advertisement to sell your program to another library.

Unfortunately, unless staff time is not a major factor, and you have a person who is adept at flowcharting and programming, the local outlay in human resources can be costly. Also, a person who programs only as a sideline could inadvertently construct an algorithm that is inefficient and time consuming. In such an instance, valuable access time on a PC that is busy with a complicated subprogram loop could be inhibited. This is a particular hazard with database programs, and it is best to have a bit of help in the form of consultants or developmental tools. Program generators can be a bailout in this instance, and that is the thrust of this article.

Your Silent Partner:

The Code Generator

Science fiction has entertained the theme of robots which generate robots which ..., etc. for many years. This has also been true of computer science. For at least two decades, systems programmers have predicted the ultimate in self-fulfilling programming languages. At infinity, when there will be no new knowledge to discover in the field of data processing, the last frontier will have been the perfection of the "tell-me-approximately-what-you-want-to-do-and-I'll-make-a-program" language. But here we'll slip a couple of notches back into reality and take advantage of the help that is now available to allow us to create our own, customized programs.

Ask many librarians to name a database manager, and they'll come back with dBASE III, (*1) dBASE VI, (*2) or R:BASE for DOS. (*3) Indeed, these programs are quite popular and share a wide following. They also have some advanced features, such as run-time modules and compilers (discussed later), of which many casual programmers do not avail themselves. Pity, for (cost notwithstanding) the special features make a world of difference in performance for only a small extra investment of time.

R:BASE and dBASE also have another common feature: each package includes a program code generator. There is also a third-party vendor that publishes a rather elaborate code writer for dBASE, Bytel Corporation, which retails its package under the trade name Genifer. (*4) The latter, in fact, is the feature under review here, and its capabilities will be the pivot of this article. It is also the purpose of this article to familiarize the reader with some of the processes which are indigenous to program generation techniques. At the conclusion, we will look briefly at some of the alternative choices in database programming that are available for the more sophisticated programmer.

R:BASE and dBASE are both "high end" (elaborately complimented) languages that ultimately accomplish the same thing: the management of large quantities of data. They just go about their business differently. R:BASE resembles the so-called "flat file" philosophy, in which everything is tabular.

dBASE uses a relational database structure, although in dBASE IV, a more tabular form of access called SQL (structured query language) is optionally available. Those persons more experienced with mainframe database programming will recognize SQL as a familiar dialect. dBASE IV's publisher, Ashton-Tate, had some initial problems with its SQL, however, and most of the current literature on both dBASE III PLUS and dBASE IV still reflects the traditional dBASE language.

The Application

For our two accounting programs, we noted both similarities and differences. The acquisitions accounting program would consist of a bibliographic database of materials ordered, and a funds database of monies available in each of thirty-eight appropriations. It had to have screen-oriented editing modules and print-out capabilities. Appropriations funds had to be modifiable at any time during the year, and it had to be possible to add/delete new accounts without interfering with totals in the existing ones.

The records management program for student aides was similar, because only one database was necessary for personal information and another for financial aid data. However, the logic of the two accounting programs would be structurally different. A book title could belong to any of a number of payout funds, but a student was attributable to only one fund the entire year (i.e., he or she could not receive financial aid from more than one source). A student could therefore "belong" to only one fund, and his or her personal record had to be accessed each time a work/study paycheck was cut.

We also decided that, since the book order database would handle a maximum of 4,000 entries per fiscal year and the student aides program would encounter no more than 100 grant recipients for the same time period, database (i.e., disk storage) size did not seem to be a problem. Separate indexes were needed for title and ISBN fields for the book order file. It was possible to have two independent indexes for the book order database, based on those same ISBN and title delimiters. Therefore, we decided that we could afford the luxury of generous character string identifiers for both book titles and student personnel records.

The result was that, to use the prior language, we were able to tell the program generator software "approximately" what we wanted, but for each program, some customization had to be performed. The customization is the part that is "tailored to fit" your specific environment, that which you would not have received if you had purchased one of the one-size-fits-all packages which guarantees compatibility for your library.

The Process

As mentioned, R:BASE and dBASE (both releases III PLUS and IV) include modules that will generate usable program code. R:BASE calls its program the Applications Express, and dBASE uses the term Applications Generator.

Both work in a similar fashion: the user is guided through menus of steps that begin with the definition of the database (record) structure. Henceforth, processes unfold that let you design the input screens, set up the report formats, and relate the databases where formal software links are required. Problems arise if you desire some very specific computations or want to mix data from several source files. In short, you can use the proprietary code generators to create some rather sophisticated data management programs, but you come away feeling that the modules are somewhat lacking in personality.

We decided to consign our loyalties to dBASE III PLUS. This choice was made because there is a considerable body of support literature for this de facto standard language. [5] We found that, at least in our own circumstances, the use of the Genifer program (which generates code only for dBASE, and only for IBM compatible computers) worked best. this was in no small part due to the fact that it would also work in tandem with dBASE III PLUS's own code generation module, in a hybrid environment. And so it should have been, since Genifer's price tag (at $395, not a lightweight) added considerably to the cash outlay for the database package. Keep in mind, however, that any code generated therefrom is royalty-free and that a dozen programs cost no more than one, except for program coding time invested.

Genifer also has several features more highly developed than those in the basic dBASE package. For one, Genifer acts as an administrator for all the programs in the larger whole and keeps track of global variables and indexes for the entire application. Genifer also allows you to create your own Help screens and throws some of its own grids (for keyboard interpretations) into your program code. Thne Genifer program shells for dBASE IV further allow incorporation of the new pop-up menu features where Help screens are required.

The program also allows you to incorporate parachutes and safety nets. The data dictionary creation module makes available two methods of data entry verification -- one against a second database and another from a list -- that prevent your data entry person from accidentally inputting an invalid field.

The program generators are separated into menu generation, maintenance program generation, and report (hard copy and screen) design. It is easy to change your mind about a feature you decide you don't like. You simply alter the part of the program you wish to modify, issue the regeneration command, and the old program module is replaced. The menu generator allows you to set up subprogram selections by way of light bars (reverse video) on the screen.

Unfortunately, however, there is no mouse support for this feature. This is the module that allows you to incorporate some of your proprietary code. If you have written a custom program module or have used separate dBASE code utilities, you simply inform Genifer's menu creator of your subprogram's existence, and it can be called from a sign-on screen like any other piece of generated code.

Our people liked the fact that the accounting program invocation (main menu) appeared proclaiming "Chicago State University," making them feel that the package was created "just for them" (which, in fact, it was). They also liked the provision that, if you become weary of the workscreen colors after interfacing with the program for a time, Genifer allows you to change the colors with only a couple of keystrokes, regenerating the program in a new decor.

One outstanding feature of the Genifer software is that it prints full documentation of your program, complete with lists of index keys, record structures, screen field assignments, look-up relationships, and environment settings. It takes an inch-thick document, which was the result of our acquisitions accounting program, to make you realize just how much tedium is saved even by letting the code generator write the generic procedures for you.

Another noteworthy feature of Genifer is its own documentation. The user manual is 450 pages long, and it includes an interactive tutorial with sample programs on the distribution diskettes. Each feature is discussed in several locations throughout the manual, and the illustrations are appropriate. There is full source listing for the template language (explained later), and the book generously cross-references itself. With a minimum of practice, it is not difficult to go from the printed documentation to the program and create database applications using only the embedded help utility in the Genifer software.

Genifer has a couple of glitches, which are to be expected of a relatively complicated program. It is somewhat difficult to follow the manual's interpretation of the zoom function, an essential element where two databases must be interconnected on a common field. In all fairness, this feature is not easy to follow in the dBASE manual, either, and requires several rereadings (and a bit of practice) to fully comprehend. Also, the Genifer manual could have detailed the report printing sequence a bit more fully, particularly on the matter of break headers. The latter is the feature that allows totals to be computed and like items to be grouped on print-outs. Some of the tips for performing calculations were in a READ.ME file on the floppy disks, and could be easily overlooked.

Be mindful that Genifer (like many other third-party programs) is not sanctioned by Ashton-Tate, and, as such, is not supported by that vendor of dBASE. If you need assistance with the program, you must go through Bytel, which has just announced a fee-based technical support program for registered Genifer users. If you need a technician, it will cost you $85 per year (or $1 per minute) to discuss your problem over the telephone with the company. This writer is not aware of any currently existing special interest group (SIG) for Genifer.

By request, Bytel will mail you a demonstration disk that illustrates the program's more significant features. The demo is attractive and could imply that a fully workable application is possible with a minimum of programming input.

To be fair, this is possible only if each and every detail, pitfall, screen design, and data field is completely predicted in advance. The self-perpetuating robots still don't exist. More accurately, it is possible to revise a reasonably lengthy program in an hour or so, but as for any project, a usable result takes time and planning. Don't count on setting up a programming assembly line with Genifer; a bit of sweat equity still must be invested.

Advanced Features

We had to write one relatively lengthy custom program module for the acquisitions accounting program. We found that it was more efficient for database updates to be performed after raw data (i.e., book orders) had been entered, at the end of the computing session. This allows faster data entry, since calculations are not made "on the fly," after each record is saved to disk.

The subroutine created what was one of the more difficult problems to solve. The original program was created on a Zenith 248 computer, an IBM PC-AT clone. This machine has a wider bus architecture than the PC, and with its 8-mHz clock and no-wait state memory, it is considered to be "fast" hardware. Once completed, the accounting program was ported to the acquisitions department's IBM PS/2 model 30. Immediately noticeable was that the file update module, a custom-written subprogram, slowed by a factor of about three.

At this point, we began to have second thoughts about our frivolity with string lengths. However, a bit of experimentation with reduced character strings proved that shorter titles and abbreviated student names didn't make much difference in computation times. This was primarily because (at least in our programs) dBASE was performing its housekeeping via the index files and not by way of character-by-character string comparisons. It was necessary to focus attentions elsewhere for a way to speed up the program.

The standard dBASE (and R:BASE) packages run programs under a command interpreter. this is a feature similar to the ROM BASIC routines included in the circuitry of the original IBM PCs. Each time a program statement is typed at the keyboard or read from a program file, it is passed to the command interpreter before action is taken. This provision is to make the pprogram fully interactive with the user, but it renders all activity compute-bound, since each command is essentially a subroutine call. This is what was happening with our update module for acquisitions accounting.

Ashton-Tate offers an adjunct to dBASE III PLUS, the dBRUN run-time module. [6] This accessory program turns dBASE III PLUS into a pseudocompiler. dBRUN must still be present in the same directory path of the dBASE .PRG (program) file, as with the dBASE III PLUS interpreter, but dBRUN eliminates the need for the interpreter's command shell and leaves only the callable functions to which the running program must refer. R:BASE in its previous version, R:BASE System V, offered a similar program entitled, appropriately, R:BASE System V Runtime.

In short, with a run-time module you lose the interpretative ability (to which you can still revert by simply switching back to the dBASE .EXE file), but you gain disk space and speed by ridding your program of its excess verbiage. A side benefit is that you can "hide" your program code (to prevent unauthorized alterations, etc.) in an encrypted format that dBRUN can understand. The use of dBRUN allowed our acquisitions department's PS/2 to regain the lost speed of the custom (update) program module.

There are several ways to go first class with database programming, if your budget permits. In addition to the standard packages, R:BASE and dBASE IV sell separate, extended versions of their software called the R:BASE Compiler [7] and the dBASE IV Developers' Edition, [8] respectively. Each one reads the appropriate program code and generates an executable program module in binary (.EXE) format. The operation is similar to that of other language compilers, and the resultant code runs extremely fast, since there is no interpreter or run-time module to maintain on the hard disk.

Other than speed, the biggest advantage of the executable code is portability; you should be able to run the compiled programs on almost any IBM or IBM-compatible. The catch: the compiler programs are relatively expensive, $895 for the R:BASE version and $1,295 for the dBASE edition. Incidentally, the R:BASE compiler will also recognize program code written for the older R:BASE System Vinterpreter.

If you already own dBASE IV, you can upgrade to the Developers' Edition for about $500. "Developers' Edition" means just that: these packages are intended primarily for persons who write and sell programs on a commercial basis. This does not mean that libraries ought to shy away from the software just because of the relative expense, only that price of these programs, like any other budgeted item, should be considered in the proper perspective. But there are no royalties involved in selling your executable program code, and there is nothing to prevent a library from selling copies of its accounting programs if the library thinks there is a market.

As an aside, where price is a consideration, be advised that the dBASE IV Developers' Edition includes the code for the template language of the applications generator. Genifer works the same way; your input to the program determines the statements Genifer will pull from the template libraries, modified to your specifications, resulting in program code. It is also possible for you to create custom templates, if you want to repeatedly generate proprietary code through Genifer. This fact is stated here to suggest that buyers of the Developers' Edition might want to consider the economics of having a redundant package (i. e., Genifer) if both the Developers' Edition and Genifer are purchased.

Keep in mind also that (as of this writing) Ashton-Tate is still supplying a run-time module similar to dBRUN with the Developers' Edition, with the binary (.EXE) code compiler to be shipped later to all registered users.

One other consideration should be made when considering the compiler options. The dBASE IV Developers' Edition is actually an extension of the interpreter (base) package, whereas the R:BASE compiler is not. The renders the total package price of R:BASE (interpreter plus compiler) considerably higher ($1,620 versus $1,295 for dBASE). However, the R:BASE compiler package can run as a stand-alone program.

The justification for the added expense of purchasing both R:BASE modules is speed; because of the programmer's direct interaction with the program, it is considerably less time consuming to analyze and debug a program with an interpreter, saving the final (permanent) version for the compiler.


Some options do exist, and all are rather sophisticated. dBASE IV and R:BASE are both available in OS/2 [9] versions. You must have an IBM/AT or compatible machine running an 80286 or 80386 microprocessor, and a minimum of 2 to 2.5 megabytes of RAM to use the OS/2 operating system.

The advantage is that, if you have a compute-bound program (like the update module in our acquisitions accounting program), you can start it under OS/2 and switch to another program. While you are working on something else, the origigal program (and possibly several others) is executing "in the background," or multitasking.

The standard edition of dBASE IV is made available in either a DOS version or an OS/2 version at the same price. If you want to use the OS/2 release, you must consummate the licensing and obtain the program disks by mail, and if you want to run both the DOS and OS/2 versions of dBASE IV, you must pay an additional license fee of $100. R:BASE for OS/2 is sold as a separate package and can be purchased as such, over the counter.

Buttonware Corporation sells and promotes a shareware-based program called PC-File:dB, [10] which can import and export dBASE III PLUS-compatible files. It is a relatively inexpensive yet efficient program, and could be an economical alternative to purchasing multiple licenses for dBASE III PLUS. Each department in the library that must read the dBASE III PLUS database files could do so with a copy of PC-File:dB on a local PC workstation, and there is even a $15 version from Public Brand Software, [11] which is legally copyable.

PC-File:dB has two valuable side benefits. At this writing, Buttonware is creating a run-time module (similar in function to dBRUN) for PCFile:dB that will be royalty-free and cost less than $100. You must be a registered user of the basic, $89 version, but the package is still a bargain.

PCFile:dB is also an excellent teaching tool. For classes in introductory computer science, its features are typical of the "larger" programs, and its flat file, screen capture orientation make it ideal for semester projects, such as the creation of mailing lists and bibliographies.

Several authors have attempted to create inexpensive dBASE code generators, and a few are quite good. A note-worthly example is dPROG, [12] which uses a screen painting technique to define database fields. The programmer uses the video screen as a palette, and, with a few keystrokes, inputs definitions from which dPROG can create a usable .PRG file. A demonstration disk of this program, version 1.21, is also available from Public Brand Software. [13]

PBS and some other SIG vendors have occasionally offered prepackaged dBASE programs, which contain the .PRG files (code) and some sample data files. These are usually aimed at very narrow markets, but a specific application (usually offered quite inexpensively) might be close enough to your needs that it could be used with a minimum of modification. Public Brand also catalogs some rather exotic dBASE utility disks which include such things as a screen design utility that generates a simple forms generation program. [14]

Several other products are valuable, particularly if you have a staff member who is interested in programming in fundamental computer languages, or if your library is affiliated closely with an academic computing department. Lattice, Inc., provides a software package called dBC III Plus, [15] which allows a programmer to incorporate dBASE III PLUS compatible files into C language programs. The libraries are available for Lattice C, Microsoft C. and Turbo C.

Lattice company also makes available an RPG II compiler [16] whose data files are generated in dBASE III PLUS-compatible format. Both DBC III Plus and RPG II cause generation of executable (binary) code, which results in very fast database access times.

A rival program to dBC III called Accsys [17] further allows Quick Basic programmers to write code that recognizes dBASE III Plus and dBASE IV .DBF (database), .NDX, .MDX (index), and .DBT (memo) files. Another product based in the C language is Clipper, [18] which can also generate binary code from .PRG (i.e., dBASE program code) files and whose database routines are compatible with the dBASE structure.

One of Clipper's outstanding values is, to a systems programmer, that it allows easy incorporation of C language subroutines. Very precise computations are thus callable from dBASE programs, rendering dBASE as powerful as some of the low-level, machine-oriented languages. But since the aforementioned software packages embrace separate programming languages and do represent true .PRG generators, they are not reviewed here.

Chicago State University engages many of its book orders through Black-well North America, which, as is typical of several other vendors, makes available a PC-based telecommunications program for order submission. Unfortunately (for us, at least), the BNA database file structures are founded in the BASIC language, and we must currently enter a few book order fields twice to take advantage of our local accounting system. A future project will be to create an interface program that will allow the use of data entered into the BNA program to be input simultaneously into the dBASE-based accounting program. With the knowledge of the language tools mentioned in the preceding paragraphs, we at least have a head start on the methodology we want to use.

Sources and Products Mentioned

The following is more of a finder's list than a bibliography for the programs and sources presented in this article. Where given, the prices were full retail at the time this article was prepared. It is assumed that readers will avail themselves of the usual contacts and friendly (to the budget) supply sources, for discounts on the majority of these packages are known to abound.

(1,2,6,8) dBASE III PLUS (version 1.1): $695. dBRUM for dBASE III PLUS (run-time module): $250 for five copies (licenses). dBASE IV (version 1.0) Standard Edition: $795. dBASE IV (version 1.0) Developers' Edition (includes Standard Edition): $1,295.

Contact Ashton-Tate at 20101 Hamilton Avenue, Torrance, CA 90502-1319.

(3,7) R:BASE for DOS (version 2.11): $725. R:BASE for OS/2: $895. R:BASE Compiler: $895.

Contact Microrim, Inc. at POB 97022, 3925 159th Avenue N.E., Redmond, WA 98073-9722.

(4) Genifer 2.0A: $395.

Contact Bytel Corporation at 1029 Solano Avenue, Berkeley, CA 94706.

(5) One suggested reference is: Beiser, Karl. Essential Guide To dBASE III+ in Libraries. Westport, CT: Meckler, 1987. 276 pp.

(9) OS/2 Standard Edition (version 1.0): $325. OS/2 Standard Editions with Presentation Manager (version 1.1): free or nominally priced upgrade for registered users of version 1.0. OS/2 Extended Edition (version 1.0): $725. OS/2 Extended Edition (version 1.1): upgrade policy similar to Standard Edition's.

Contact IBM Corporation at PO 1328-C, Boca Raton, FL 33432. Contact Microsoft Corporation at 16011 NE 36th Way, POB 97017, Redmond, WA 98073-9717. Both companies maintain distribution points in larger cities for their software products.

It should be noted that the Extended Edition works only with true IBM hardware. Before purchasing a copy of OS/2 for a non-IBM (but compatible) machine, check to determine whether there is a proprietary version for your brand of hardware. Prices may vary, and the upgrades from OEM vendors might not always be gratis.

(10) PC-File:dB: $89.

Contact Button Ware, c/o Jim Button, at POB 96058, Bellvue, WA 98009.

(11) Public Brand Software (catalog): $1.00.

Contact POB 51315, Indianapolis, IN 46251.

This vendor distributes many shareware and public domain programs at $5 per disk (IBM and compatibles only, 5.25-inch disk format; 3.5-inch format, additional $1 per disk). For example, a demonstration version of PC-file:dB is available as PBS's disks no. DB26a.0, DB26b.0 and DB26c.0.

(12) dPROG (version 3.0): $39.95, plus $2 shipping and handling.

Contact University Research, Inc. at 602 South 48th Street, Suite 228, Philadelphia, PA 19143.

(13) PBS's disk no. Dt7.0: $5 plus $5 shipping and handling.

Public Brand Software, see note 11 for address.

(14) PBS's disks no. DT4.0 and DT5.1: $5 each plus $5 shipping and handling.

Public Brand Software, see note 11 for address.

(15,16) dBC III Plus: $750. RPG II Compiler: $1,400.

Contact Lattice, Inc. at 2500 South Highland Avenue, Lombard, IL 60148.

There exists a smaller library package known as dBC III, which parallels the features of the older dBASE III version 1.0, and sells for $250. A less expensive alternative, it lacks mainly the networking capabilities of the Plus version.

(17) Accsys: $395 ($795 with source code).

Contact Copia International, Ltd. at 1964 Richton Drive, Wheaton, IL 60187.

(18) Clipper (Summer '87 version): $695.

Contact Nantucker Corporation at 12555 W. Jefferson Blvd., Los Angeles, CA 90066.

Harold C. Ogg is an automation librarian for Chicago State University.
COPYRIGHT 1989 Information Today, Inc.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 1989 Gale, Cengage Learning. All rights reserved.

Article Details
Printer friendly Cite/link Email Feedback
Author:Ogg, Harold C.
Publication:Computers in Libraries
Date:Dec 1, 1989
Previous Article:Using microcomputers to train staff.
Next Article:In the stacks with Bookends.

Terms of use | Privacy policy | Copyright © 2018 Farlex, Inc. | Feedback | For webmasters