FUJITSU FS Logo
HomeMigrationsProductsServicesInformationNewsPartnersStudentPricingAbout Us
Quick Search  
 
DownloadShop Support
Home > Support
Support Title   Support graphic
Support
Version 5 and 6
Support Status
Helpful Tips
Sample Programs
Version 4
Support Status
Helpful Tips
ODBC Compatibility
Release Notes 4.2
Sample Programs
Release Notes 4.0 only
Run Time Installers
Version 3
Support Status
Helpful Tips
Using ODBC
Programming Staff
Quick Start Tutorial
Sample Programs
Support FAQ's

Exercise 4:

P-Staff—The Fujitsu Editor and Correcting Errors

Discussion: To this point, these exercises have used our data file COBOL programs, but eventually you will have to create your own programs. COBOL programs can be developed in a variety of ways. You could use Notepad, or any other editor with which you are familiar. You can also use a word processor (e.g., Microsoft Word or Word Perfect) provide you save the file as an ASCII or text file. Alternatively, you can use the Editor in Programming Staff (P-Staff).

The P-Staff Editor is very powerful, but there is no need to learn all of its features. Indeed, you can probably use it immediately, with the experience you have had with other editors—for example, insertion and replacement. You then can use the on-line help facility, as necessary to master the more sophisticated commands and gain proficiency.

The steps that follow show how to initiate the editor, how to find and correct compilation errors, how to make changes, and how to save the edited program. It also shows a technique for coordinating your work between the diagnostic messages and the source code. Finally, the exercise suggests some changes you might wish to make in the standard configuration.


 

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.

Image 139

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

Image 140

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.

Image 141

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.)

Image 142

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.

Image 143

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.

Image 144

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:

  • Place a period after PROCESS-RECORDS
  • Change WRTE to WRITE
  • Delete the period at the end of line 63.

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.

Image 145

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.

Image 146

Figure 4.7 Setup Basic Status Window.


  All Rights Reserved, Copyright © FUJITSU SOFTWARE CORPORATION 2003