pc.b Processing Code/Restore Processor

pc.b

Command pc.b Processing Code/Restore Processor
Applicable release versions: AP
Category Restore Processor (84)
Description maintains a horizontal relationship (bridge) between an attribute in one item and an item in another file (or the same file) on the system level.
"file.reference"
refers to the file to which the bridge is being built.

"ac1"
contains the attribute in the current item that contains the item-id(s) of the item(s) in the "bridged-to" file. This attribute may be multi-valued in the current file. If it is multi-valued, all items are updated in the "bridged-to" file.

"ac2"
contains the attribute in the "bridged-to" item that is referenced by the bridge. Unless the optional "operator" parameter is specified, this attribute contains the item-id of the current item as a cross-reference to the current file.

If the optional "operator" parameter is specified as an arithmetic operation with an operand "ac3", the attribute contains the result of the arithmetic operation.

"ac3;+|-"
adds or subtracts the value of the attribute specified by "ac3" in the current item to the value in the attribute "ac2" in the "bridged-to" item. The inverse operation is performed on a delete. No backward pointer is maintained in the bridged-to item.

If the current item is deleted, the inverse operation is performed to automatically return the value in "ac2" to its original value.

"d"
is used as an override to delete the current item even if "ac1" is not null. Without this option, the current item may not be deleted if the attribute specified by "ac1" contains a value.

All values of "ac1" in the current item are processed. If a value in "ac1" is changed, the value of "ac2" in the original item specified by "ac1" is deleted, and this value is added to attribute "ac2" of the new item pointed to by "ac1".

The advantage of a bridge correlative is that it performs a function which previously took significant Pick/BASIC coding. When an item is added, changed, or deleted, all the bridge correlatives in the file-defining item of the file dictionary are processed for that item.
Syntax bfile.reference;ac1;ac2{;{ac3;+|-}|d}
Options
Example
bentity;1;5
This example places the item-id of the current item into attribute 5 of the 
"entity" file. Attribute 1 in the current file contains the item-id 
in the entity file.

bproduct;2;4;3;+
This example adds the value of attribute 3 in the current item to the value in 
attribute 4 of the bridged-to item (product file). The result of the addition 
is stored in attribute 4 of the bridged item.
Purpose
Related output-conversion
file.reference
processing.codes
file.defining.items
basic.replace.statement
pc.bridge
pc