Additional Utilities [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 2
Additional Utilities
HP HP ALLBASE/4GL includes a number of utility programs. These programs
are summarized below.
HP4STOA This utility extracts the source information for an
application from the HP HP ALLBASE/4GL S-files and
writes the information to an ASCII text file.
HP4ATOS This utility takes the source code for an application
from an ASCII text file and writes the information into
a set of S-files.
HP4REMK This utility rebuilds the indexes for the HP HP
ALLBASE/4GL system files (S-files).
HP4REOD This utility rebuilds the HP HP ALLBASE/4GL S-file data
files.
HP4TUPLD This utility extracts dictionary definitions from an HP
TurboIMAGE/iX schema and writes the information to an
ASCII text file in a format that can be used by HP4ATOS.
The HP4TUPLD utility is only useful if you are using the HP TurboIMAGE/iX
data manager for your applications. Refer to chapter 10, HP
TurboIMAGE/iX for details about HP4TUPLD.
The other utilities are described below.
HP4STOA and HP4ATOS
The HP4STOA (S-files to ASCII) utility extracts clean source code from an
application's S-files and writes the source to an ASCII text file. It
reports the inconsistencies it has encountered to $STDLIST.
The HP4ATOS (ASCII to S-file) utility allows you to load the clean source
code from the ASCII text file into a set of S-files.
To use these utilities, you must exit from HP HP ALLBASE/4GL and run the
utilities directly from MPE/iX.
System Variables.
To use HP4STOA and HP4ATOS, you must set the HP4SPATH system variable.
The HP4SPATH system variable identifies the location of the group and
account containing the HP HP ALLBASE/4GL S-files.
Keywords File.
The file HP4GLKWD.PUB.SYS contains the names of all keywords, objects,
and symbols (used to mark the start and end of objects) used by HP4STOA
and HP4ATOS. To use these utilities, HP4GLKWD.PUB.SYS must exist.
Running HP4STOA.
The syntax for running HP4STOA from the MPE/iX prompt is:
HP4STOA " [options] [> FILENAME]"
or
RUN HP4STOA.PUB.SYS [; INFO = "options"] [; STDLIST = FILENAME]
Options can be any of the options listed below. Options may be combined,
but all objects will be unloaded in the order specified.
HP4STOA sends its output to $STDLIST unless you redirect output to a
file. FILENAME can be any name you choose. If you redirect output to a
file, you must create the file before running HP4STOA, with an adequate
record size and an adequate number of records specified.
Command Line Options.
Option Description
-a The application name or version name to be unloaded.
[application_name] If a development security code exists, it must
[:dev_sec_code] accompany the application or version name. You must
specify an application name, except when you wish to
unload system class objects. In this case, do not
specify an application name, but specify administ as
the user name. Refer to pages 13-18 for a full list
of system class objects.
-b Prints out only the names and types of all objects
that are unloaded. If you don't select this option,
all object details are output.
-c As much data as possible about any S-file
inconsistencies will be printed. This option cannot
be used with the -b option.
-d Checks all default values and gives warnings for
unusual default settings. This option will produce
many warnings when run on older S-files.
-e Disables error checking. Only use this option with
error-free S-files. This option speeds up output.
-i Messages regarding S-files with incomplete
descriptions are not displayed. This option is best
used when unloading run-time S-files.
-k Ignores namelists in S-files for non-list objects.
Instead it creates its own list by scanning the S-
files for appropriate records. HP4STOA does not
differentiate between select lists and files, so this
option will not build the namelist for SQL select
lists.
-n No output is produced to an ASCII file. Details are
reported to $STDLIST. Use this option to check for
S-file inconsistencies.
-o object type Allows you to specify objects that you wish to
[,object list] unload. You may specify the type of object by using
an object type code (refer to page 13-16). To
specify that objects matching particular character
strings (regular expressions) are unloaded, list the
character strings. This list of strings is called
the object list. If you don't include an object
list, HP HP ALLBASE/4GL will unload all objects
within the specified object type. You can also use
an asterisk to specify `all objects'.
-u [user_name] Specifies the name of a registered user of the
[:user_password] application. If a password exists for the user, it
must be included with the user name. You must always
specify a user name when you run HP4STOA. When you
specify system class objects in an HP4STOA command
you must specify administ as the user. Refer to page
13-18 for a full list of system class objects.
-w Disables warning message output.
-v object type Allows you to specify objects that you do not wish to
[,object list] unload. You may specify the type of object by using
an object type code (refer to page 13-16). You may
specify that objects matching particular character
strings (regular expressions) are not unloaded. To
do so, list the character strings in an object list.
If you don't include an object list, all objects
within the specified object type will not be
unloaded. You can also use an asterisk to specify
`all objects'.
-z Produces dummy dates and times in the output.
An example of running HP4STOA is:
HP4STOA "-udevelopr:password -aexample -od* -olfp > CLEANFIL"
or
RUN HP4STOA.PUB.SYS ; INFO = "-udevelopr:password -aexample -od* -olfp" ;
STDLIST = CLEANFIL
Both commands load all clean dictionary objects, functions and processes
from the application example into the CLEANFIL ASCII file.
Object Types.
An object type normally consists of two letters representing a class and
type of object. The codes for all object types are listed below.
In addition, you may combine object types by listing the class letter and
specific types. For instance, -olfp specifies functions and processes,
-ol* specifies all logic classes, and -o*f specifies functions and field
specifications.
If no object types or classes are specified, the entire application's
S-files are loaded into an ASCII file.
Dictionary Class
da Application title (prompt)
dc Constant (alphanumeric)
dd Database item: file,SQL, table
df Field specification
dg Range
dh Help screen
dl SQL select list
dm Message
dn Numeric
dr Record
ds Scratch pad
dt Table
du Calculated item
dv Variable
dw Work area
Screen Class
sk Function (soft) keys
ss Screen
Logic Class
ld Decision table
lf Function
lp Process
ls SQL logic block
Report Class
rr Report
System Class
xa Application headers
xb HP TurboIMAGE/iX database names
xd Terminal display attributes
xm System master
xp HP TurboIMAGE/iX database access parameters
xs Synonyms
xt Master titles
xu Users
xv Version headers
When you run HP4STOA, an exit value is returned to indicate the success
of the program. For a list of these values, refer to the Exit Values
section in this chapter.
Running HP4ATOS.
HP4ATOS allows you to load a clean application from an ASCII file into a
set of S-files.
The syntax for running HP4ATOS at the MPE/iX prompt is:
HP4ATOS " [options] < FILENAME"
or
RUN HP4ATOS.PUB.SYS [; INFO = "options"] [; STDIN = FILENAME]
Options can be any of the options listed below. Options may be combined,
but all objects will be loaded in the order specified. If no options are
specified, the entire contents of the ASCII file are loaded into S-files.
FILENAME is the name of the ASCII file you wish to load into S-files.
Command Line Options.
Option Description
-a The application name or version name to be loaded.
[application_name] If a development security code exists, it must
[:dev_sec_code] accompany the application or version name. You must
specify an application name, except when you wish to
load system class objects into the S-files. In this
case, do not specify an application name, but specify
administ as the user name. Refer above for a full
list of system class objects.
-e Ensures that objects that already exist in the
S-files are not overwritten.
-f Forces the original date and time fields of an object
to be stored. If this option is not specified, all
dates and times will be stored as the current date
and time.
-n No output is produced to the S-files, only to the
screen. Use this option to check ASCII files for
inconsistencies. If you use this option to check
ASCII files of applications that do not exist in the
S-files, errors may occur because HP4ATOS assumes
that previous objects in the ASCII file have been
loaded.
-u [user_name] Specifies the name of a registered user of the
[:user_password] application. If a password exists for the user, it
must be included with the user name. You must always
specify a user name. If you wish to load system
class objects into S-files, you must specify administ
as the user, and you must not specify an application.
Refer to page 13-18 for a full list of system class
objects.
An example of running HP4ATOS is:
HP4ATOS "-udevelopr -aexample < CLEANFIL"
or
RUN HP4ATOS.PUB.SYS ; INFO = "-udevelopr:password -aexample "; STDIN =
CLEANFIL
This loads the clean S-file information from CLEANFIL into the current
S-files for the example application. HP4ATOS produces warning messages
when an item in the ASCII text file corresponds in name to an item in the
S-files, but the definitions of the items differs. Warning messages are
also produced for other errors found in the definitions of items. For a
list of exit values returned by HP4ATOS, refer to Exit Values below.
Exit Values.
HP4STOA and HP4ATOS both produce one of the following exit values after
being run. These values indicate the status of the completed job:
0 Job completed correctly with no inconsistencies.
1 Command line is incorrect. Check that you have the correct command
format.
2 S-files or ASCII files contain inconsistencies.
3 Operating system failure. Perhaps there was insufficient memory
available.
HP4REMK
The HP4REMK utility remakes the indexes for the HP HP ALLBASE/4GL system
files (S-files).
To use this utility, you must exit from HP HP ALLBASE/4GL and ensure that
no other users are currently accessing the system.
You must set the MPE/iX variable HP4SPATH before you can use the HP4REMK
utility. The HP4SPATH variable identifies the location of the group and
account containing the HP HP ALLBASE/4GL S-files. For example, if the
S-files are in the HP4S.HP4GL group and account, you must set the
HP4SPATH variable as follows:
SETVAR HP4SPATH "HP4S.HP4GL"
To run HP4REMK, enter the command HP4REMK at the MPE/iX prompt. The
HP4REMK utility then displays a message asking you to enter the number of
the file to be remade. The HP HP ALLBASE/4GL S-files are numbered from 1
to 11 inclusive. The following table indicates the main contents of each
S-file.
S-file Contents
s01 Terminal attributes
s02 End users, developers, and groups
s03 Application and version definitions
s04 Descriptions
s05 Messages, master titles, and prompts
s06 Help screens
s07 Field specifications
s08 System records and some list items
s09 List items (constants, variables, numerics,
calculated items, validation items, data
files, scratch-pad fields).
s10 Source
s11 Generated items
You can also run the HP4REMK program by specifying the file numbers on
the command line in the format:
HP4REMK "[-l] [-s] [n[-m]]"
The -l option produces a long listing of each block that is read and
remade. The -s `silent' option runs HP4REMK without the progressive
count of blocks read.
In this command, n and m are numbers between 1 and 11 indicating the
S-file or range of S-files to be remade.
HP4REOD
CAUTION You must use the HP4REMK utility to rebuild the HP ALLBASE/4GL
S-file indexes before you attempt to use the HP4REOD utility.
If you don't remake the file indexes before attempting to
reorder the files, you may corrupt the HP ALLBASE/4GL S-files.
The HP4REOD utility compacts the HP HP ALLBASE/4GL S-files to recover
disk space occupied by logically deleted records.
To use the HP4REOD utility, exit from the HP HP ALLBASE/4GL system and
ensure that no other users are accessing the system.
To run HP4REOD, you must set the MPE/iX variable HP4SPATH. (refer to
HP4REMK above.) After you have used the HP4REMK utility to rebuild the
S-file indexes, start the HP4REOD utility by entering the command HP4REOD
at the MPE/iX prompt.
HP4REOD then displays a message asking you to enter the number of the
file to be reordered. The HP HP ALLBASE/4GL S- files are numbered from 1
to 11 inclusive.
You can also run the HP4REOD program by specifying the file numbers on
the command line in the format:
HP4REOD "[-s] [n[-m]]"
The -s `silent' option runs HP4REMK without the progressive count of
blocks read.
In this command, n and m are numbers between 1 and 11 indicating the
S-file or range of S-files to be reordered.
Checking S-files for Inconsistencies
To identify and correct any S-file inconsistencies, complete the
following instructions. These instructions assume that you are familiar
with the HP4STOA, HP4ATOS, HP4REMK, and HP4REOD utilities, which you will
need to use in these procedures.
CAUTION Be sure to use the version of these utilities that corresponds
to the version of your S-files. Using a mixed version could
result in inconsistencies being reported that don't exist and in
some inconsistencies not being reported.
Each step provides a template for the command you will need to enter, but
you must replace the slanted text parameters with the suitable names.
For more information about the parameters, refer to the description of
the appropriate utility, in this chapter.
Before you start, you should create a file to which you will redirect
HP4STOA output. You must create the file before running HP4STOA, with an
adequate record size and an adequate number of records specified.
CAUTION Backup your S-file group before attempting to correct your
S-files. This ensures that if you inadvertently destroy your
S-files, they can be recovered.
1. At the MPE/iX prompt, use HP4STOA with the -n option to produce a
list of S-file inconsistencies in your application.
RUN HP4STOA.PUB.SYS ; INFO = "-uuser_name:user_password
-aapplication_name:dev_sec_code -n" ; STDLIST = FILENAME
At this point you may decide to delete the inconsistencies, or you
may wish to repair the inconsistencies. If you wish to repair the
inconsistencies, refer to Repairing Inconsistencies later in this
chapter.
If you decide to delete the inconsistencies, you should make a
backup of your application. If you do not make a backup of your
application, any objects with inconsistencies will be
irretrievable.
2. Use HP4STOA without the -n option to create an ASCII file
containing the consistent portions of the application. The
inconsistent objects are not unloaded.
RUN HP4STOA.PUB.SYS ; INFO = "-uuser_name:user_password
-aapplication_name:dev_sec_code" ; STDLIST = FILENAME
3. Log in to HP HP ALLBASE/4GL as the administrator, and delete the
application using the administrator deletions screen. All
inconsistent objects are deleted with the application.
4. Redefine the application using the application definition screen.
5. Use HP4ATOS to load the clean application in the ASCII file back
into the application's S-files.
RUN HP4ATOS.PUB.SYS ; INFO = "-uuser_name:user_password
-aapplication_name:dev_sec_code" ; STDIN = FILENAME
6. Log in to HP HP ALLBASE/4GL as a developer and regenerate all
objects in your application.
7. Then use HP4REMK and HP4REOD to remake and reorder the indexes for
the S-files.
HP4REMK 1 -11
HP4REOD 1 -11
8. You may now wish to recreate and regenerate any inconsistent
objects that were deleted from the application. You should also
correct and regenerate any objects that caused a regeneration
error.
Repairing Inconsistencies
Many of the error messages given by HP4STOA are self-explanatory and easy
to fix. For example, the message ERROR: Bad scroll bottom specified,
object screen, test_scr indicates that the scroll bottom line value given
for the test_scr screen is incorrect. To correct this error, correct the
value and regenerate the screen. Other examples of this type of error
include variables, ranges, or calculated items with illegal numbers of
decimal places. Correct these types of errors in HP HP ALLBASE/4GL and
recommit and regenerate the relevant objects.
Some errors are less specific, and usually indicate a severe
inconsistency. An example of this type of error is ERROR: Object not
complete: S-file corruption, object report, testrep.
For each object that causes an error of this type:
1. Log in to HP HP ALLBASE/4GL as a developer, and print out as many
details about the object as possible, using the catalog printing
screen. This will ensure that if you cannot repair the object,
you will have the information to recreate the object later.
2. If a message is displayed suggesting that an object is undefined,
move to the screen used to define the object and try to display
the object. If the object is retrieved, use the screen printing
facility to print out as much information as possible. If the
object still cannot be retrieved, enter a new header or
description (if appropriate). Then return to the Catalog Printing
screen and try again to print the object details.
3. If the object can be retrieved, you may be able to repair it.
Recommit header and detail information, and then generate the
object (if appropriate).
4. If you cannot retrieve the object at all, delete it using the
Catalog Deletion screen. If you cannot delete it, use the
-vobject_name option when you use HP4STOA to ignore the object.
When you delete the entire application, and reload it from the
ASCII file using HP4ATOS, the item will not be present. You can
recreate the object later in the S- files.
5. In some rare cases, you may be able to call up an object's details
but you may not be able to recommit them. If this occurs, print
out the object's details and delete the object. Then recreate the
object (and regenerate it if appropriate).
After correcting as many inconsistencies as you can, run HP4STOA to check
that the inconsistencies have been fixed. Continue the cycle of running
HP4STOA and then repairing inconsistencies until all inconsistencies are
removed.
MPE/iX 5.0 Documentation