TurboIMAGE/V to TurboIMAGE/XL [ HP Business BASIC/XL Migration Guide ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Migration Guide
TurboIMAGE/V to TurboIMAGE/XL
In a few cases, you must make changes to applications before recompiling
in native mode. These changes involve error handling and real number
handling. Other differences involve maintenance and operation in areas
like Transaction Management(XM), Intrinsic Level Recovery and Autodefer.
Refer to the TurboIMAGE/V to TurboIMAGE/XL Migration Guide for more
detailed information about their differences.
Status Array and Error Handling
There are some differences in status array format because of addressing
differences. This can affect error handling of TurboIMAGE/XL
applications.
Words 5-10 of the status array contain architecture dependent
information, (like db- and pb-relative addresses), in most database
statements. Program and data offsets for native mode programs require 4
bytes; MPE V programs only require 2 bytes. Therefore, the status array
cannot hold as many addresses for native mode programs since the size of
the status array is the same. The virtual addresses of the caller and
the password, qualifier, or data set parameter are kept in the internal
database system file--DBU control block. You can only obtain this
information by calling DBERROR or DBEXPLAIN immediately after the
TurboIMAGE call.
10 DBGET Base$ INTO Buffer$, DATASET..., STATUS = Status1(*)
20 DBFIND Base$, ITEMS = "KEY", KEY =..., STATUS = Status2(*)
30 DBEXPLAIN STATUS = Status1(*) !report DBGET error
The example above is acceptable for TurboIMAGE/V because the returned
status array, status 1 (E),contains all the information used by DBEXPLAIN
and DBERROR. Some information about the last database statement is kept
in the DBU control block because less information is kept in the status
array for native mode applications. You must call DBERROR or DBEXPLAIN
immediately following the database statement to report this information.
In the example above, DBEXPLAIN will pick up information from the DBU
control block that pertains to the DBFIND call rather than the DBGET
call, since DBFIND was the last database statement used.
Real Number Handling
TurboIMAGE databases must be STORE/RESTORE compatible, therefore,
TurboIMAGE/XL stores real numbers in MPE V floating-point format.
TurboIMAGE does not translate real numbers to IEEE format. The default
real data type in a native mode program is IEEE real format. Specify
"REALV" in the IN DATASET or PACKFMT statement if you use real data types
in your database. When you use the "REALV" keyword, IEEE real numbers
are changed to MPE/V real numbers before variables are written to the
packed string. Also, MPE V real numbers are changed to IEEE real numbers
before the value in the packed string is assigned to the appropriate
variable.
______________________________________________________________________________
| |
| |
| 10 Data_det1: PACKFMT Real_no1, Sreal_no2, Str$ |
| 20 Master: IN DATASET "Master" USE Name$, SKIP 10, Real_prod_no |
| 30 Detail: IN DATASET "Detail" USE Real_prod_no, Address$ |
| 40 Thread_list: THREAD IS Master, Detail |
| 50 DBGET USING Data_set1, DATASET = "set1", MODE = 4, KEY = Record_no |
| 60 SORT USING Thread_list; Real_prod_no |
| |
______________________________________________________________________________
The previous example uses real numbers in the PACKFMT statement and in
the IN DATASET statement. Add REALV to statements 10, 20, and 30:
_________________________________________________________________________________
| |
| |
| 10 Data_set1: PACKFMT REALV Real_no1, Sreal_no2, Str$ |
| 20 Master: IN DATASET "Master" USE REALV Name$, SKIP 10, Real_prod_no |
| 30 Detail: IN DATASET "Detail" USE REALV Real_prod_no, Address$ |
| |
_________________________________________________________________________________
Figure 5-1. REALV Example
Use the CHANGE command to globally add the keyword REALV to PACKFMT and
IN DATASET statements in your program. You can use the CHANGE command
from the interpreter.
______________________________________________________________________
| |
| |
| >CHANGE "PACKFMT" to "PACKFMT REALV" in all |
| >CHANGE "USE" to "USE REALV" in all |
| |
______________________________________________________________________
Figure 5-2. Using the CHANGE Command
HP Business BASIC/V ignores the keyword REALV.
The change in floating-point real format representation creates some
potential problems. MPE V format allows real numbers and short real
numbers to have exponents only up to +/-77. IEEE real format allows
exponents of +308/-324. IEEE short real format allows exponents of only
+38/-45.
The following problems can occur:
* Short real overflow or underflow occurs during conversion from MPE V
real format when a short real variable is unpacked from the packed
buffer and the short real data stored in the database exceeds the
range of +38/-45.
* Real overflow or underflow occurs during conversion from IEEE real
format to MPE V real if data exceeds the range of +/-77 when the real
variable is packed to the packed buffer.
Run programs in compatibility mode if applications contain databases that
use short reals that exceed the range of +38/-45.
Using TurboIMAGE/XL Databases on MPE V Machines
MPE XL machines allow larger files than MPE V machines. MPE V machines
allow files of only 500 megabytes. MPE XL machines allow files of 2
gigabytes. Databases that contain data sets larger than 500 megabytes
cannot be restored to MPE V machines. Carefully monitor size changes in
mixed system environments because TurboIMAGE/XL creates this larger size
data set without warning.
Use the TRANSPORT option to store databases that you are moving from
TurboIMAGE/XL to TurboIMAGE/V. Using the TRANSPORT option ensures that
the file label on the tape can be read by either RESTORE or DBRESTORE on
the MPE V machine.
Use the following command to move databases from MPE XL machines to MPE V
machines (The database must be less than 500 megabytes or your files will
not be stored and DBSTORE will abort):
run DBSTORE.PUB.SYS;info = TRANSPORT
MPE/iX 5.0 Documentation