Compiling and Executing Transact Programs [ Getting Started With TRANSACT V ] MPE/iX 5.0 Documentation
Getting Started With TRANSACT V
Compiling and Executing Transact Programs
Transact programs are written using an editor such as EDIT/V or TDP. The
source is then compiled using TRANCOMP and the resulting program is
executed using TRANSACT.
If you are using DICTIONARY/V to hold the definition of your database,
TRANCOMP expects the dictionary to be called DICT and to reside in the
PUB group. However, you can override this by issuing a file equate
before running TRANCOMP, such as:
FILE DICT.PUB=dictname[.group]
Figure 1-1 shows the steps used to compile and execute a TRANSACT
program. After the discussion of compiling and executing programs in
complete, the same program used in Figure 1-1 is displayed in Figure 1-2,
where it is accompanied by a line-by-line explanation.
__________________________________________________________________________________
| |
| 1 :file dict.pub=dict |
| 2 :run trancomp.pub.sys |
| |
| 3 TRANSACT/3000 COMPILER HP32247A.02.02 - (C) Hewlett-Packard Co. 1984 |
| |
| 4 SOURCE FILE> ex1 |
| |
| 5 LIST FILE> |
| |
| 6 CONTROL> |
| 7 TRANSACT/3000 COMPILER A.02.02 : TUE, MAR 19, 1985, 11:07 AM COMPILED|
| 8 LISTING OF FILE EX1.HOWTO.MILLER PAGE 1 |
| |
| |
| 9 COMPILING WITH OPTIONS: LIST,CODE,DICT,ERRS |
| |
| 10 1.000 system ex1,base=orders; |
| 11 2.000 0000 list(auto) customer; |
| 12 3.000 0005 output(serial) customer; |
| |
| 13 CODE FILE STATUS: NEW |
| |
| |
| 14 0 COMPILATION ERRORS |
| 15 PROCESSOR TIME=00:00:04 |
| 16 ELAPSED TIME=00:00:09 |
| |
| 17 END OF PROGRAM |
| 18 :run transact.pub.sys |
| |
| 19 TRANSACT/3000 HP32247A.02.02 - (C) Hewlett-Packard Co. 1984 |
| |
| 20 SYSTEM NAME> ex1 |
| |
| 21 PASSWORD FOR ORDERS> |
__________________________________________________________________________________
Figure 1-1. Compiling and executing a TRANSACT Program
Let's look at what is happening in the above example on a line by line
basis.
1 By default, the compiler TRANCOMP expects the user dictionary to
be in the PUB group of the logon account. We are changing the
default to be the logon group by issuing a file equation.
2 We run the Transact compiler to transform the source input into
intermediate code which can then be executed using the processor
(see line 18 below).
4 The compiler asks for the name of the file containing the source
code to be compiled. The source code was previously entered by
using a text editor such as EDIT or TDP.
5 By default, the compiler listing goes to $STDLIST (the terminal
in this case). To override the default, we could have entered
the name of a file or directed the output to the printer.
6 The compiler has many options which can be entered at this
prompt. These options control, for example, whether an object
file is created, the format of the listing generated, ways to
optimize code generated so as to conserve resources, such as
stack usage, and so forth.
No options are required. Quite often, you will probably not want
to see the compiled listing. You can keep the listing from
printing by responding NOLIST.
9 Since we entered no options, TRANCOMP uses the default options,
which are shown here. LIST means that a listing will be
generated, CODE calls for the generation of an object or code
file, DICT specifies that a dictionary is to be used to resolve
file and element definitions, and ERRS means that we want to see
a listing of any compiler errors.
10 Lines 10 through 12 are the compiler listing. In this example,
the listing consists of the source line number, an internal
location reference number that is used when test modes are in
effect to debug a program, and the source text.
18 At this point we run TRANSACT. The compiler does not create a
true object or program file like that produced by COBOL or
PASCAL. It creates what is called an intermediate processor code
file. TRANSACT interprets the contents of this file and performs
the functionality of our source program.
20 The processor asks for the name used in the SYSTEM statement of
the source program. It uses this name to figure out the name of
the MPE file that contains the intermediate processor code. The
MPE file name is always in the format IPname where name is the
name used in the SYSTEM statement. For this system, the name is
IPEX1.
MPE/iX 5.0 Documentation