[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
The REFORMAT Utility converts source programs between terminal format and conventional ANSI format. Consider the two formats and their characteristics:
The HP COBOL Reference Manual describes both formats in detail.
On OpenVMS, REFORMAT is installed by the HP COBOL installation procedure (if you answered "yes" to the query during installation), and is placed in the following location:
SYS$SYSTEM:REFORMAT.EXE <> |
This chapter provides the following information about using the REFORMAT utility:
On OpenVMS, you can define REFORMAT as a foreign command as follows:
$ REFORMAT :== "$SYS$SYSTEM:REFORMAT.EXE" |
Then you would type the following command:
$ reformat <> |
On Tru64 UNIX, type the following:
% reformat <> |
REFORMAT - REFORMAT - Enter Y for ANSI-to-terminal conversion, or REFORMAT - Enter N (default) for terminal-to-ANSI conversion. REFORMAT - Enter ^Z to exit. REFORMAT - ANSI-to-terminal format conversion mode [ Y / [N] ]? n REFORMAT - Terminal-to-ANSI format selected REFORMAT - Terminal-format input file spec : myprog.cob REFORMAT - ANSI-format output file spec: myprog2.cob REFORMAT - Columns 73 to 80: REFORMAT - 42 Terminal source code records converted to ANSI format REFORMAT - REFORMAT - Enter Y for ANSI-to-terminal conversion, or REFORMAT - Enter N (default) for terminal-to-ANSI conversion. REFORMAT - Enter ^Z to exit. REFORMAT - ANSI-to-terminal format conversion mode [ Y / [N] ]? ^Z REFORMAT - |
In the preceding example, the following events took place:
The Ctrl/Z ends this reformatting session.
14.2 ANSI-to-Terminal Format Conversion
REFORMAT converts each ANSI format source line to terminal format by:
When you convert programs that contain continued nonnumeric literals you should examine those literals to see if they require any changes. (This should occur only when going from ANSI format to terminal format.) |
REFORMAT converts each terminal format source line to ANSI format by:
Note that it is possible to construct a terminal format line that converts to an invalid ANSI formatted line. Consider the case of a conditional compilation line with a long nonnumeric literal:
\A 01 ART PIC X(80) VALUE "A ... A". |
This statement cannot be reformatted to a valid ANSI statement. The
literal is 80 characters long, which indicates that the literal must be
continued on the next line by placing a continuation symbol (-) in the
indicator area. The line is also a conditional compilation line, which
indicates that the A is to be placed in the indicator area. Clearly
both characters cannot be placed in the indicator area. HP COBOL
continues the conditional compilation line by placing the A in the
indicator area. This means the program remains valid if conditionals
are not used in the compilation because the lines become comment lines.
If conditionals are used, you must locate and correct these invalid
lines. The reformat program is a text processor and does not perform
the level of checking required by lines such as these. You detect this
error during a compile operation.
14.4 REFORMAT Error Messages
If any of your responses to the prompts are incorrect, REFORMAT displays error messages. It replaces the parentheses and the parenthetical text with the appropriate format type you specified.
REFORMAT - Error in opening (ANSI or terminal) format input file: REFORMAT - (ANSI or terminal) format input file spec: |
The system could not open the input file; either the file is not on the specified device or you typed the file name incorrectly.
The default device is SYS$DISK on OpenVMS systems; it is stdin on Tru64 UNIX systems.
To continue processing, examine the input file specification and type a corrected version. To process another file, type a new input file specification. To end execution, type Ctrl/Z (on OpenVMS systems) or CTRL/D (on Tru64 UNIX systems).
REFORMAT - Error in opening (ANSI or terminal) format output file: REFORMAT - (ANSI or terminal) format output file spec: |
The system could not open the output file. An incorrectly typed file specification usually causes this error.
The default device is SYS$DISK on OpenVMS systems; it is ./ on Tru64 UNIX systems.
To continue, examine the output file specification and type a corrected version. To end execution, type Ctrl/Z (on OpenVMS systems) or CTRL/D (on Tru64 UNIX systems).
REFORMAT - (ANSI or terminal) format input file is empty REFORMAT - (ANSI or terminal) format input file spec: |
The system opened an empty input file. To continue, type a new input file specification. To end execution, type Ctrl/Z (on OpenVMS systems) or CTRL/D (on Tru64 UNIX systems).
Previous | Next | Contents | Index |