The SHAPE statement is able to produce three different types of hierarchical recordsets:
A relation hierarchy is a set of parent records and associated child records.
A parameterized hierarchy also contains parent records and associated child records, but fetches child records on demand.
A grouping hierarchy is a parent recordset composed of aggregate functions and the related detail records as the children.