Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
CATALOG command (DataBasic) (m618704+catalog.htm)
Catalogs a compiled DataBasic program, so that it can be run by entering the program name at TCL and shared between accounts.
See Introduction to DataBasic for descriptions of the types of item used and created by this process.
CATALOG file-specifier item-list {(options}
file-specifier Specifies the file containing the items to be cataloged.
item-list A space-separated list containing the item-ids of the items containing the programs to be cataloged. An asterisk (*) specifies all the items in the file. The list can be provided by an immediately-preceding list-generating command.
I Catalogs the program under another account name. The system prompts you for the account name.
If an executable item was not created when the program was compiled, an item is created (or updated) in the global POINTER-FILE; the id of this item includes the name of the specified account. A command definition item is also created in the MDof the specified account. See Operation for details.
If you do not specify an account, the system uses the account you are in.
L Must be used with the I option - updates the local MD rather than the MD of the specified account. This means that the program cannot be executed from the account under which it is cataloged.
If you specify the L option without the I option, it is ignored.
O Overwrites any existing item in the MD file. Without this option, CATALOG will not proceed if an MD entry with the specified program name is found, but it is not a cataloged DataBasic program definition item referencing the program being cataloged.
R Forces regeneration of an executable (platform-specific) item in the dictionary of the file from a deliverable (platform-independent) item. See Introduction to DataBasic for descriptions of these different types of item.
If the MD item points to the global POINTER-FILE, an error message is displayed.
This option is provided for compatibility with Procs written for earlier versions of Reality. Its use should not normally be necessary.
X Does not update any MD. This means you cannot execute the cataloged program at TCL.
You must use the X option with the I option. If you specify the X option without the I option, it is ignored.
Cataloging a program is a two stage process:
If the executable (platform-specific) item does not already exist, one is created from the deliverable (platform-independent) item and saved in the global POINTER-FILE with the name account*C*name, where account is the name of the account under which the program was cataloged, and name is the name of the program (that is, the name of the deliverable item without the initial $ or £).
See Introduction to DataBasic for descriptions of these different types of item.
Notes:
When the program has been cataloged, the following message is displayed:
[241] item-id Cataloged.
If the item already exists in the MD, but is not a DataBasic program definition item, the program is not cataloged and the following message is displayed:
[415] item-id Exists on file
The CATALOG.COMP environment option relaxes the conditions under which an MD entry can be overwritten. If set, any cataloged DataBasic program definition item can be replaced, even if it references a different program. However, unlike the O option, CATALOG.COMP prevents other types of MD entry being overwritten.
There are several reasons why you should catalog your DataBasic programs:
The DataBasic history feature provides a mechanism to log history data to allow reporting and analysis of the usage of DataBasic programs, subroutines and external user functions. You create a separate HISTORY data section in your source files, and this section is used by the system to log the history usage of the code whenever it is complied and catalogued.
When any local source item is compiled and catalogued, a history log item with the same DataBasic program name is automatically written to the HISTORY data section of the source file (if such a section exists). Any previous history item is overwritten. The log item comprises the attributes shown in the following table (compilation is logged in attributes 1-7, cataloguing is logged in attributes 8-14).
Attribute | Description |
---|---|
1 |
Date of successful compilation (internal format) |
2 |
Time of successful compilation (internal format) |
3 |
PLID of successful compilation |
4 |
ID of user requesting compilation |
5 |
Account of successful compilation |
6 |
Location of source (filename - including the data section, if appropriate) |
7 |
Source item ID |
8 |
Date of successful catalog (internal format) |
9 |
Time of successful catalog (internal format) |
10 |
PLID of successful catalog |
11 |
ID of user requesting catalog |
12 |
Account of successful catalog |
13 |
Location of executable object (filename) |
14 |
Executable item ID |
Note: By default, nothing is logged; the user has to enable compile/catalogue history logging by adding the HISTORY data section.
To list the items in the POINTER-FILE, use the LISTPF command.
To display the time and date that a specified cataloged DataBasic program was compiled use the
:
CATALOG BP TEST1
Catalogs the program TEST1 in the file BP. The following message is displayed:
[241] 'TEST1' Cataloged.
:
CATALOG FILEA 1 2 3
Catalogs the three DataBasic programs with item-ids of 1, 2, and 3 in file FILEA. The following messages are displayed:
[241] '1' Cataloged.
[241] '2' Cataloged.
[241] '3' Cataloged.
:
CATALOG BP TEST2 (R
Uses the deliverable item for the program TEST2 in the file BP to regenerate the executable item and the command definition item TEST2 in the account's MD. Any existing items are overwritten or deleted. The following message is displayed:
[241] 'TEST' Cataloged.