Verifying the Installation [ COBOL/HP-UX Getting Started for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Getting Started for the Series 700 and 800
Verifying the Installation
We have provided you with a number of demonstration programs. The source
code for these is in the directory "demo" of the issued software. This
section will guide you through using two of these, pi and stock1, as a
quick check that the COBOL system is working and is accurately configured
to your CRT.
This will also serve as a brief introduction to using the system; the
following chapter, Sample Session, gives a full tutorial.
Note: This section will not use the UNIX system linker, since if you
are planning to use cobrun to run all your programs you do not
not have to have the linker installed.
The pi program simply displays on the screen the mathematical constant pi
to 12 decimal places. This program is the basic test for the Micro Focus
enhanced DISPLAY statement.
Do not run stock1 until you are confident that pi is working correctly.
The stock1 program tests the Micro Focus enhanced ACCEPT statement (which
provides the basic interactive functions) and indexed sequential file
input-output.
Other demonstration programs are explained in detail in your COBOL
Operating Guide.
Copy the source files pi.cbl and stock1.cbl into one of your work
directories before working through this section.
The pi Program
Enter the command line:
cob -vuP pi.cbl
As the file extension of the input file is .cbl, cob recognizes the file
as a COBOL source file and invokes the Compiler. The -v option causes
messages output by cob to be displayed on the screen. The -u option
causes the input file to be processed to a .gnt file. The "P" option
makes cob create a listing file.
The first lines displayed tell you that the Compiler has been loaded and
is executing:
* Micro Focus COBOL for Unix V3.0 revision nnn Compiler
* Copyright 1984,1992 Micro Focus Ltd URN xxxxx/xxx/nnnnnx
* Accepted VERBOSE
* Accepted LIST (pi.lst)
* Compiling pi.cbl
When the compilation is finished, the Compiler outputs a message giving
the sizes of the code and data areas. It will have generated three
files: the list file pi.lst; the intermediate code file pi.int; and the
information file for Animator, pi.idy.
cob goes straight on to invoke the Generator. This displays:
* Micro Focus COBOL for Unix V3.0 revision nnn Code Generator
* Copyright 1984,1992 Micro Focus Ltd URN xxxxx/xxn/nnnnnx
* Accepted - verbose
* Generating pi.int
When code generation is finished, the Generator outputs a message giving
the sizes of the code, data, and literal areas. The object file is
called pi.gnt.
Running pi
To run pi, use the cobrun command, as follows:
cobrun pi
After a few moments you will see the screen clear, the cursor will appear
at the top left, and the pi screen will be displayed. It shows the terms
of pi, rapidly changing, and finishing up thus:
CALCULATION OF PI
NEXT TERM IS 0.000000000000
PI IS 3.141592653589
If the screen is not displayed, or is displayed incorrectly, refer to the
section "Problems" later in this chapter.
The Program stock1
The stock1 program is a simple stock control program. To submit
stock1.cbl to cob and output a dynamically loadable native code program
called stock1.gnt, enter:
cob -vuP stock1.cbl
After cob has finished, run the file stock1.gnt that it has produced.
Enter:
cobrun stock1
After a few moments you will see the screen clear, the cursor will appear
at the top left, and then the stock1 screen will be displayed as
illustrated below.
STOCK CODE < >
DESCRIPTION < >
UNIT SIZE < >
If the screen does not appear as shown, refer to the section "Problems"
later in this chapter.
At this point, the program is waiting for you to enter data via the
keyboard using your normal cursor movement controls and the Enter key.
Before entering any data, try moving the cursor from data item to data
item using the cursor control keys.
If the cursor keys are working correctly, try entering data. Check that
the following features are working:
* Left zero fill - keying "<1. >" into the UNIT SIZE field should
result in <0001>
* Enter - pressing this enters the screen-full of data
Enter several screens of data in this way. There are two cases when
pressing Enter should not result in the data being written away:
* If the UNIT SIZE is not numeric
* If a record with this STOCK CODE number already exists on the file
To finish the run, enter spaces into the STOCK CODE field and press
Enter.
Problems
If you have problems in getting the correct results from the
demonstration programs, here are some suggestions.
The pi Program When you are running pi, if anything other than
the illustrated result appears on your screen,
the most likely cause is that your UNIX system
has not been correctly configured. Check that
the operating system terminfo entry for your
terminal type is correct and that the TERM
environment variable is set correctly.
The stock1 Program When you are running stock1, typical problems
that you could have are:
* Cursor fails to move, or moves
incorrectly, with one or more of the
cursor movement keys. If you are using
the keys correctly, the operating system
terminfo entry for your terminal type
may be incorrect.
* A run-time error message may occur if
the files STOCK.IT and STOCK.IT.idx,
generated and referenced by stock1, have
been corrupted; for example, by a
previous run of stock1 that was
incorrectly terminated. To recover,
delete these two files and start again
with the stock1 program.
MPE/iX 5.0 Documentation