Uploading Definitions [ HP ALLBASE/4GL Developer Reference Manual Vol. 1 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 1
Uploading Definitions
The HP4TUPLD utility converts information about data items, data entries
and data sets contained in an HP TurboIMAGE/iX schema to HP ALLBASE/4GL
field specifications, record layouts and data set (file) definitions.
The converted definitions can be printed to the screen or redirected to a
file.
Once the HP TurboIMAGE/iX definitions have been converted, the HP4ATOS
utility can be used to write the information into a set of HP ALLBASE/4GL
S-files. Note that you must define the application in HP ALLBASE/4GL
before the definitions can be uploaded into the S-files. For more
information about HP4ATOS, refer to chapter 13.
Running HP4TUPLD
The syntax for running HP4TUPLD from the MPE/iX prompt is:
HP4TUPLD "-aapplication -oobject_type [SCHEMA_FILE] > [ATOSFILE]"
SCHEMA_FILE is the name of the schema file for the HP TurboIMAGE/iX
database that you wish to upload.
ATOSFILE is the name of the ASCII file produced by the upload utility.
If you do not specify a file, HP4TUPLD sends its output to $STDLIST. If
you redirect output to a file, you must create the file before running
HP4TUPLD, with an adequate record size and an adequate number of records
specified.
Command Line Parameters.
Parameter Description
-a application_name The name of the HP ALLBASE/4GL application that will
access the HP TurboIMAGE/iX database. All definitions
must be associated with an application. The application
need not exist when you run HP4TUPLD.
-o object_type This parameter is optional. You may specify either x or
d as the object type. If you don't specify an object
type, -od is assumed.
If you wish to extract developer information from the
schema file (data set and data item definitions),
specify d.
If you wish to extract administrator information from
the schema file (the database definition and the
database access parameter), specify x. No password is
extracted from the schema file; the user class password
is set to blank. Note that you may find it faster to
log in to HP ALLBASE/4GL as administ and define this
information within HP ALLBASE/4GL.
Naming Conventions.
Naming rules in HP TurboIMAGE/iX differ somewhat to HP ALLBASE/4GL naming
rules. The following characters may be used in HP TurboIMAGE/iX names,
but may not be used in HP ALLBASE/4GL names:
+, -, *, /, ?, ', #, %, &, and @.
HP4TUPLD transforms any of the above characters to underscores (_) in its
output. For example, the HP TurboIMAGE/iX name ADDRESS&ZIP-CODE would be
converted to address_zip_code by HP4TUPLD.
HP TurboIMAGE/iX data set names may be up to 16 characters long. Within
HP ALLBASE/4GL, the international data set name may be no longer than 8
characters. HP4TUPLD truncates any data set names that are longer than 8
characters.
In some circumstances, truncation or conversion of characters by HP4TUPLD
causes two HP TurboIMAGE/iX names to be converted to the same name. If
this occurs, HP4TUPLD generates a unique name for the second name, and
displays a message when this occurs.
You may edit the output file produced by HP4TUPLD to change any database,
data set, or data item names.
An Example.
An example of running HP4TUPLD is:
HP4TUPLD "-asupply -od STKCNTRL > STOCK"
This command uploads the developer definitions from an HP TurboIMAGE/iX
schema file called STKCNTRL into an ASCII text file STOCK.
The Upload Procedure
To use HP4TUPLD and HP4STOA to upload definitions into HP ALLBASE/4GL,
follow the procedure below.
Before you start, you must create the file to which HP4TUPLD output will
be redirected. You must create the file before running HP4TUPLD, with an
adequate record size and an adequate number of records specified.
To upload definitions:
1. Run HP4TUPLD with the -ox option to upload the administrator
system items from the HP TurboIMAGE/iX schema, or with the -od
option to upload the developer definitions from the HP
TurboIMAGE/iX schema. Direct the output to a file.
2. Make sure that the application you wish to load the definitions
into is defined in the HP ALLBASE/4GL administrator application.
3. Run HP4ATOS to load the HP TurboIMAGE/iX details into your
application by entering the following at the MPE/iX prompt:
HP4ATOS "-uusername:password -aapplication_name:dev_sec_code
<ATOSFILE"
If you are loading administrator system items, the application
name is administ.
If you are loading dictionary definitions, use the name of the
application that will access HP TurboIMAGE/iX.
You may also wish to specify that if the names of any objects
being loaded match existing objects in the S-files, the existing
objects are not overwritten. To do so, use the -e option when you
run HP4ATOS. If you don't use the -e option, any existing objects
are overwritten if an object in the ATOSFILE file has the same
name. For details about this option, refer to chapter 13.
When you next run HP ALLBASE/4GL to develop the application, you will
find that the field specifications, default record layouts, and data set
definitions are defined for the application.
If any messages, warnings, or errors occur during the upload, an error
listing is written to the HP4LIST file designator.
Upload Defaults.
HP4TUPLD produces a field specification for each HP TurboIMAGE/iX data
item that is uploaded. This section describes how the data item
attributes are translated by HP4UPLD to HP ALLBASE/4GL field
specification attributes.
The repeat count of the field specification is set to the sub-item count
of the data item. The edit code, storage type, and display length are
determined according to the HP TurboIMAGE/iX type designator.
Note that some legal HP TurboIMAGE/iX type designator and sub-item length
combinations are not accepted by HP4TUPLD, as they have no corresponding
HP ALLBASE/4GL edit code and storage type. If HP4TUPLD comes across such
data items in the schema file, an error message is issued, and the data
item is ignored. You may manually create a field specification within HP
ALLBASE/4GL that best suits your needs, within the HP ALLBASE/4GL
restrictions.
The table below describes the values that are set for each type
designator.
--------------------------------------------------------------------------------------------------
- HP TurboIMAGE - HP ALLBASE/4GL -
--------------------------------------------------------------------------------------------------
- Type Designator - Edit Code - Storage Type - Display Length -
--------------------------------------------------------------------------------------------------
- I - S - I - 6 -
--------------------------------------------------------------------------------------------------
- I2 - S - L - 11 -
--------------------------------------------------------------------------------------------------
- I4 - S - P - 20 -
--------------------------------------------------------------------------------------------------
- In - ERROR if n != 1, 2, or 4 -
--------------------------------------------------------------------------------------------------
- J - S - I - 5 -
--------------------------------------------------------------------------------------------------
- J2 - S - L - 10 -
--------------------------------------------------------------------------------------------------
- J4 - S - P - 19 -
--------------------------------------------------------------------------------------------------
- Jn - ERROR if n != 1, 2, or 4 -
--------------------------------------------------------------------------------------------------
- K - N - I - 5 -
--------------------------------------------------------------------------------------------------
- K2 - N - L - 10 -
--------------------------------------------------------------------------------------------------
- K4 - S - P - 19 -
--------------------------------------------------------------------------------------------------
- Kn - ERROR if n != 1, 2, or 4 -
--------------------------------------------------------------------------------------------------
- R2 - S - F - 10 -
--------------------------------------------------------------------------------------------------
- R4 - S - G - 20 -
--------------------------------------------------------------------------------------------------
- Rn - ERROR if n != 1, 2, or 4 -
--------------------------------------------------------------------------------------------------
- Pn - S - P - n + 1 -
--------------------------------------------------------------------------------------------------
- Un - U - C - n -
--------------------------------------------------------------------------------------------------
- Xn - X - C - n -
--------------------------------------------------------------------------------------------------
- Zn - S - C - n + 2 -
--------------------------------------------------------------------------------------------------
MPE/iX 5.0 Documentation