![]() |
![]() |
|
|
|
|
|
|
|
|
|
|
|
||
|
|
Step 4.1: Compile a Program with Errors Following the procedure in Step5 of Exercise 2, compile SENIORCE.CBL in Chaptr02 of the data files. Be sure to use the Options button to set the program as MAIN. Refer to Exercise 2 Step 5 if you are unsure about doing this step.
Figure 4.1 WINCOMP Window for SENIORCE. Step 4.2: Interpret Compilation Errors Once the program has compiled you should see the following Editor Window appear as in Figure 4.2. Do not be concerned about the error messages that you see, since we have included errors for just this purpose. You may want to expand the window to see the entire message. Notice that each diagnostic message begins with the full file path of the source file plus the line number of the error. This feature allows you to move quickly between the messages and the program code
Figure 4.2 Compiler Error Messages. Step 4.3: Moving Between Messages and Source Code Position your cursor under the "C" at the beginning of the first diagnostic message.
Figure 4.3 Using Tag Jump to Find Errors. When the cursor is in place, press the F11 key. This key is the "Tag Jump" key. The "tag" is the path record number of another file. Pressing F11 takes you to the new file and opens a new Editor window. When you press the Tag Jump key (F11), you should see a window like this. (You may get a warning message about renumbering. If so, reply Yes.)
Figure 4.4 Cursor Located at Error Line in Program. In the Editor window, your cursor is located at the start of the offending line position. In this case, the error is a missing period at the end of PROCESS-RECORDS (a paragraph name). Correct the error by placing a period in the proper location. The question now is "How do I get back to the diagnostic messages?" You need to use a Windows trick so that you can see both the source listing and the diagnostic messages. Click on the Windows Menu and you will see that the Editor has both files available. You could simply jump from one Window to the other by clicking on the one you wanted. A better approach is to use either the Cascade or Tile option. Either one will display both windows on the screen. Cascade option places one of the windows in front of the other. You can then move the windows and resize them as you wish.
Figure 4.5 Opening Two Editor Window. The Tile option places the two windows next to each other vertically. You may find this arrangement useful. We recommend that you consider arranging the windows horizontally. In this configuration, you can see the most of the error message and the code lines. Switching from one window to the other is simply a matter of clicking the mouse at the appropriate location. However, the use of the Tag Jump key does aid in finding the error lines in the source code. Note that there is no way to do jump back to the error messages. Fujitsu documentation references a "Return Tag Jump" but this does not seem to be implemented.
Figure 4.6 Window Showing both Source Code and Error Messages. Step 4.4: Correct the Errors Using the technique described in Step 4.3: make the following corrections:
The error message given is somewhat misleading. The message should probably read: "NO CORRESPONDING ‘IF’ IS SPECIFIED. ‘END-IF’ IS IGNORED". Recompile the program. There should be no further errors associated with the program. Step 4.5: Adjusting the Editor Defaults. You may have noted tab-setting differences between the examples and the results on your computer. These differences reflect some changes we have made in the configuration of the compiler. You may want to consider the same changes. In English speaking countries, most COBOL programs are coded between columns 8 and 72 with tabbing occurring at intervals of 4 columns. One would expect the tab settings for a COBOL editor to be at 8, 12, 16, etc. The Fujitsu Editor was evidently developed for use with the Japanese language. Japanese characters each take the equivalent of two columns of data. Thus, the default tab settings start at 9 and are incremented in units of 8 columns. Unfortunately, in this version of the Editor, the first tab mark cannot be changed from column 9, but it is possible to adjust the number of spaces between tabs. Open the Editor from P-Staff, by clicking New. In the Editor Options menu, select Environment for Editor, and then Basic Status.
Figure 4.7 Open
Environment for Editor. You should now see the Setup Basic Status dialog box. Leave most of the parameters alone. However, you can change the Tab Interval to 4.
Figure 4.7 Setup Basic Status Window. |
|
|
||
| All
Rights Reserved, Copyright © FUJITSU SOFTWARE CORPORATION 2003 |