PreviousDG Interactive COBOL Source Compatibility Converting DG COBOL Data FilesNext"

Chapter 14: Reformatting a DG COBOL Source File

Source programs written in DG Interactive COBOL CRT format cannot be accepted by this COBOL system unless you first amend them using a source file formatter. This must alter the margins in these programs, and split any lines in them containing more than 72 characters, into lines of 72 characters or fewer. The reform5 facility is a source file formatter, supplied with Conversion Series 5, which reformats source programs in CRT format so that they are compatible with the requirements of this COBOL system. Any similar source file formatter can be used to reformat your programs if you do not wish to use reform5.

If you wish to supply DG Interactive COBOL programs written in CRT format to the file conversion utility Convert5, you must amend them first using reform5, or a similar source formatter.

14.1 Using reform5

To invoke reform5 enter the command:

reform5 

Once you have invoked reform5 the following message is displayed on your screen:

type in input file 

In response, type the name of the source file which you wish to reformat, then press Enter. The following message is displayed on your screen:

type in output file 

The name which you type in reply to this message is the name given to the reformatted source file. This file is now in a format which is compatible with the requirements of this COBOL system. Its name must not be the same as that of the input file.

To run reform5 in batch mode enter the command:

reform5 input-file output-file

where input-file and output-file are as described above.

14.2 Reformatting Rules

The reform5 utility amends your source program according to the following rules:

  1. If the character in column 1 is an indicator (*/-), reform5 appends six spaces to the beginning of a line.

  2. If the character in column 1 is any non-space character not mentioned in rule 1, reform5 appends seven space characters to the beginning of the line.

  3. If area A (columns 1 to 4 inclusive) contains all spaces, reform5 appends seven additional space characters to the beginning of the line. However, if the entire line contains spaces, it outputs a single 72 character line containing spaces.

  4. If a line is too long to fit onto a single 72 character line, reform5 breaks it onto subsequent lines, up to a maximum of three. Where possible, these breaks occur at a space character to preserve the program's readability.

  5. If a line is expanded beyond 132 characters, reform5 truncates the line to 132 characters. This prevents any pseudo comment areas from being included in the program source.

If you wish, you can use any source formatter that amends your source program according to the above rules; you are not restricted to using reform5.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousDG Interactive COBOL Source Compatibility Converting DG COBOL Data FilesNext"