ContentsIndexPreviousNext

6.2.1 COBOL vs. Application Language

Writing a COBOL program or an application query each has its advantages and disadvantages. Consider the following example:

Example

Your Vision file contains the names and addresses of clients and a list of the monthly revenues coming from these clients. You want to create a letter containing a summary of this data, with individual revenues displayed and totaled in a table. The tool you chose to create this letter is Microsoft Word for Windows.

The Vision file lacks an important element: the total of the revenues. You can decide to compute this total in one of two different ways.

Solution A: COBOL

One option is to create another Acucorp Vision work file containing the missing information in addition to all the other data necessary to fill out the letter. To do this, you write a COBOL program suitable for this purpose. All the computational work is done in COBOL.

This solution is especially good for people who are not very experienced with application languages. However, it is not the best approach in terms of performance, because extra work is required before the data even reaches the application.

Solution B: Application Language

Another option is to read the Vision file into the Windows application as it is, and then compute the total using some feature of this application.

This solution is faster, in that it allows you to accomplish your goal of printing the letter faster. But solution B is possible only with some tools. For example the mail merge function of Word for Windows doesn't allow you to modify or create new variables during the data processing. To perform these functions, you would need to write a program in WordBasic.

The bottom line is that each situation has a different solution. The decision you make will depend on the situation, your programming knowledge, your expertise with SQL language, and so on. In the beginning, it may be better to do as much work as possible in COBOL. Experience will suggest the best solution.