HP 3000 Manuals

Verifying the Installation [ Micro Focus COBOL for UNIX, Getting Started ] MPE/iX 5.0 Documentation


Micro Focus COBOL for UNIX, Getting Started

Verifying the Installation 

This section guides you through briefly loading the main components as a
quick check that you have installed the system correctly.  If you find
any problems, see the appendix Troubleshooting.

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
chapter Sample Session gives a full tutorial.

This section does not use the UNIX system linker, since if you are
planning to use cobrun to run all your programs you do not need the
linker installed.

The pi program displays on the screen the mathematical constant p to 12
decimal places.  This program is a 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 System 
Reference.

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.2 revision nnn Compiler
     Copyright 1984,1994 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 two files:
the list file pi.lst and the intermediate code file pi.int.

cob goes straight on to invoke the Generator.  This displays:

     Micro Focus COBOL for UNIX   V3.2 revision nnn Code Generator
     Copyright 1984,1994 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 the screen should clear, the cursor appear at the top
left, and the pi screen should 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, see the
appendix Troubleshooting.

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 the screen should clear, the cursor appear at the top
left, and the stock1 screen should be displayed as illustrated below:

      STOCK CODE      <       >
      DESCRIPTION     <       >
      UNIT SIZE       <       >

If the screen does not appear as shown, see the appendix Troubleshooting.

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 - typing:

            <1.   >

       into the UNIT SIZE field should result in:

            <0001>

   *   Enter - pressing this enters the screenful 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, enter spaces into the STOCK CODE field and press Enter.



MPE/iX 5.0 Documentation