Source Program Input [ HP COBOL II/XL Programmer's Guide ] MPE/iX 5.0 Documentation
HP COBOL II/XL Programmer's Guide
Source Program Input
You can input your source program to the COBOL compiler in these three
ways:
1. In an ASCII file.
2. In an HP TOOLSET TSAM file.
3. One line at a time, through the standard input file, $STDIN (which
can be your terminal).
ASCII File
Using an editor, you can create your program in an ASCII file. Then, you
can input the ASCII file to the COBOL compiler.
TSAM File
Using HP TOOLSET, you can create your program in a TSAM file.
HP TOOLSET is a software package designed to facilitate three programming
activities: coding, compiling, and debugging. It has six key design
features:
Feature Purpose
User Interface Allows you to communicate with HP TOOLSET
with commands and function keys.
On-Line Help Facility Provides an introduction to HP TOOLSET and
an on-line quick reference guide.
Workspace Controls all files used in development of a
single program, including source, listing,
object, and program files.
Editor Allows you to compose and modify your
source program on the terminal screen.
Program Translator Compiles and prepares your program.
Symbolic Debug Allows you to debug your program.
For complete information on HP TOOLSET, refer to the HP Toolset/XL
Reference Manual.
$STDIN File
You can input your program one line at a time through the standard input
file, $STDIN. The default for $STDIN is your terminal if you are running
the compiler interactively. If you are running the compiler from a job
stream, the default for $STDIN is the job stream file. In either case,
end the source program with ":RETURN".
Example.
In this example, your input from the terminal is underlined.
:COB85XL
PAGE 0001 HP31500A.00.00 [85] (C) HEWLETT-PACKARD CO. 1987
> ID DIVISION.
> PROGRAM-ID. TEST.
> PROCEDURE DIVISION.
> P1.
> DISPLAY "hi mom".
> STOP RUN.
>:RETURN
0 ERRORS, 0 QUESTIONABLE, 0 WARNINGS
DATA AREA IS 18 BYTES.
CPU TIME = 0:00:02. WALL TIME = 0:01:34.
END OF PROGRAM
MPE/iX 5.0 Documentation