How to handle submultivalues
Unlike most Pick systems, which can explode only multivalues, B-TREE-P can also index and browse submultivalues. In our sample NAMES files, attribute 8 might be a submultivalued list of check numbers for each multivalued payment date in attribute 7. The trick for handling submultivalues is to simply append both a multivalue number and a submultivalue number onto the ID argument in B-TREE-P subroutine calls. For example, a statement like
CALL BTPINS("CHECKS",5,BFILE,NFILE,ID:"*":V:"*":SV,ITEM)
might be used for inserting items into a submultivalued B-tree. The same rules apply: call BTPINS once for each submultivalue being indexed, use FIELD in BTPKEY to extract the current multivalue and submultivalue positions, expect concatenated identifiers to be returned by BTPFIND and BTPSEQ, use BTPDEL if a submultivalue is changed or deleted, and every submultivalue positioned after a newly inserted or deleted submultivalue must itself be deleted and reinserted in the B-tree to account for its new position in the submultivalued list.