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 MD of 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:
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.