Test Facility [ Getting Started With TRANSACT V ] MPE/iX 5.0 Documentation
Getting Started With TRANSACT V
Test Facility
Transact provides an extensive test facility to aid in the debugging of a
program. The Transact Reference manual provides a detailed description
of this facility.
Three of the options that provide the answers to most debugging problems
are options 25, 34, and 42. Option 25 provides information whenever a
database or file access occurs. Option 34 provides information whenever
a VPLUS action occurs and option 42 provides information whenever the
data storage description changes.
Depending on the program being debugged and the test option chosen,
Transact may display a considerable amount of data for you. Another
useful option which helps reduce the amount of data displayed is to
indicate a range of internal location reference numbers where the display
is to occur. Data is then displayed only when the program is executing
within the range specified. Before using this option, you must first
compile your program with the LIST option in order to get a listing of
internal location reference numbers.
The test facility by default displays the data on your terminal. Quite
often, it is desirable to direct the data to a file so as not to
interfere with terminal activity. This is especially true when debugging
a VPLUS program. The file designator used for displaying test facility
results is TRANDUMP. The default of the terminal can be altered to some
other device, typically a spooler file by doing two things. First set up
a file equate such as:
FILE TRANDUMP;DEV=LP,1
Second, when specifying the option desired to the test facility, precede
the option with a minus sign.
Below is an example of debugging a VPLUS program with test option 34 and
directing the output to a spooler file. First, the program is compiled
to get the internal location reference numbers, then the file equation is
entered to direct the test results to the TRANDUMP file. When the
program is run, test mode 34 is specified, and the debugging range is
limited to the update-customer paragraph (internal location reference
numbers 21 to 28). The last step is to look at the SPOOK output.
:run trancomp.pub.sys
TRANSACT/3000 COMPILER HP32247A.02.02 - (C) Hewlett-Packard Co. 1984
SOURCE FILE> ex74
LIST FILE>
CONTROL>
TRANSACT/3000 COMPILER A.02.02 : MON, MAR 18, 1985, 8:11 AM COMPILED
LISTING OF FILE EX13.HOWTO.MILLER PAGE 1
COMPILING WITH OPTIONS: LIST,CODE,DICT,ERRS
1.000 system ex74,base=orders,vpls=formfile;
2.000 0000 list(auto) customer;
3.000 0005 level;
4.000 0006 get(form) mainmenu,f1=add-customer
5.000 0006 ,f2=update-customer
6.000 0006 ,f3=report-customer;
6.100 0017 end;
7.000 0018
8.000 0018 add-customer:
9.000 0018
10.000 0018 get(form) vcustomer;
11.000 0019 put customer;
12.000 0020 end;
13.000 0021
14.000 0021 update-customer:
15.000 0021
16.000 0021 get(form) vcustno;
16.100 0022 set(key) list (cust-no);
17.000 0023 get customer;
18.000 0025 put(form) vcustomer;
19.000 0026 get(form) vcustomer;
20.000 0027 update customer;
21.000 0028 end;
22.000 0029
23.000 0029 report-customer:
24.000 0029
25.000 0029 get(form) vcustno;
25.100 0030 set(key)list (cust-no);
26.000 0031 get customer;
27.000 0033 put(form) vcustomer,wait=
28.000 0033 ,window=("press f1-f8 to continue");
29.000 0037 set(form) vcustomer,window=(" ");
30.000 0041 end;
CODE FILE STATUS: REPLACED
0 COMPILATION ERRORS
PROCESSOR TIME=00:00:05
ELAPSED TIME=00:00:09
END OF PROGRAM
:file trandump;dev=lp,1
:run transact.pub.sys
TRANSACT/3000 HP32247A.02.02 - (C) Hewlett-Packard Co. 1984
SYSTEM NAME> ex74,,-34,21,28
END OF PROGRAM
:run spook5.pub.sys
SPOOK5 G.01.00 (C) HEWLETT-PACKARD CO., 1983
> s
#FILE #JOB FNAME STATE OWNER
#O3449 #S344 TRANDUMP READY MARV.MILLER
> t3449
> l all
0
1 +-V-P-L-U-S---B-U-F-F-E-R---D-U-M-P----+
2 |
3 | GET(FORM) CODE: 0 FKEY: 2
4 | FORM: ..MAINMENU FILE: ..FORMFILE
5 |
6 +--------------------------------------+
7 1 00021 160:009
8 +-V-P-L-U-S---B-U-F-F-E-R---D-U-M-P----+
9 |
10 | GET(FORM) CODE: 0 FKEY: 0
11 | FORM: ..VCUSTNO . FILE: ..FORMFILE
12 |
13 | OFFSET: LIST: DATA:
14 | 0 CUST-NO 1
15 |
16 +--------------------------------------+
17 1 00022 198:000
18 1 00023 064:139
19 1 00025 161:002
20 +-V-P-L-U-S---B-U-F-F-E-R---D-U-M-P----+
21 |
22 | PUT(FORM) CODE: 0 FKEY: 0
23 | FORM: ..VCUSTOMER FILE: ..FORMFILE
24 |
25 | OFFSET: LIST: DATA:
26 | 0 CUST-NO 1
27 | 4 NAME updated name
28 | 24 STREET-ADDR street
29 | 44 CITY-STATE city
30 | 64 ZIPCODE zip
31 |
32 +--------------------------------------+
33 1 00026 160:002
34 +-V-P-L-U-S---B-U-F-F-E-R---D-U-M-P----+
35 |
36 | GET(FORM) CODE: 0 FKEY: 0
37 | FORM: ..VCUSTOMER FILE: ..FORMFILE
38 |
39 | OFFSET: LIST: DATA:
40 | 0 CUST-NO 1
41 | 4 NAME new name
42 | 24 STREET-ADDR street
43 | 44 CITY-STATE city
44 | 64 ZIPCODE zip
45 |
46 +--------------------------------------+
47 1 00027 049:011
48 1 00028 000:000
49 +-V-P-L-U-S---B-U-F-F-E-R---D-U-M-P----+
50 |
51 | GET(FORM) CODE: 0 FKEY: 8
52 | FORM: ..MAINMENU FILE: ..FORMFILE
53 |
54 +--------------------------------------+
MPE/iX 5.0 Documentation