For example, one part of JOCKEY is a huge load module, but the topmost level of code is only a few hundred lines long. It calls one subprogram to fetch an input message. Depending on the type of message, it calls another subprogram to process a completed order, or still another to cancel a previously completed order. With a little more code it starts itself up, shuts itself down, and handles error conditions. Most of the work is done by the subprograms, which are relatively isolated from each other and from the topmost module.
In order to make this strategy work, you must find a good way to carve up the application. Each subprogram should be able to do a well-defined job without interacting much with its parent program.
Other subprograms are highly generic, and can be reused repeatedly, not only in JOCKEY but also in other applications. For example, JOCKEY contains some generic routines for managing dynamically allocated memory. Almost any application could use them (though so far I haven't had any success in attracting converts).
When you write good reusable code, you need only write it once. From then on you can invoke it from any program which can use it. You save time coding in the future and you reduce the total amount of code.
(This strategy can backfire. If a change requires that the subprogram know something that it doesn't currently know, then you have to change its interface, and make corresponding changes to all the programs that call it.)
Lookup tables are good candidates for subprograms, for all the reasons discussed above. In addition, a subprogram can make the data available to other subprograms, as well as to the main program.
For example, one utility module in JOCKEY loads so-called environmental variables into its own WORKING-STORAGE. Any module in the load module can query the values of these environmental variables. In effect they become global variables. Though global variables can be abused, they can also be useful.
Subprograms may encapsulate data structures other than arrays, such as linked lists or trees.
When subprograms encapsulate data, the calling program needn't know anything about the physical format of the data. It needs only a few well-defined operations for accessing the data.