Home page  
Help >
ddlRpr() - H/Option
Version 7.11

ddlRpr() /H Option (Show Hierarchy Information)

The /H option of the ddlRpr() [RAWPRINT] API function displays hierarchy information that is more extensive than the hierarchy information displayed by the ddlRpr() /R option.

For review, the ddlRpr() API function, with no options, displays each record of a hierarchy with no explicit hierarchy information. Example 1 demonstrates the results of a simple ddlRpr() function applied to the output of a ddlRelate() function; [note that the column headings in all examples are editorial; they are not included in the output of the ddlRpr() function.]
   Example 1:
      >>clear A
      >>FIND A CUSTOMERS where CUST# eq A00173,A05072
      >>MATCH A CUSTOMERS thru CUST# with SALES
      >>MATCH A SALES thru ITEM# with INVENTORY
      >>RELATE A CUSTOMERS (SALES thru CUST# (INVENTORY thru ITEM#)) over CUST# ITEM#
      >>rpr a cust# item#
       
           Cust#  Item#
           ------ ------
           A00173
           A00173 I20981
                  I20981
           A00173 I00798
                  I00798
           A00173 I00161
                  I00161
           A05072
           A05072 I01001
                  I01001
           A05072 I00029
                  I00029
           A05072 I01280
                  I01280
When the /R option is included with the ddlRpr() function, the record number and table name are prefixed to the data display for each record. This is demonstrated in Example 2:
   Example 2:
      >>rpr/r a cust# item#
       
          Rec TableName     Cust#  Item#
          --- ------------- ------ ------
             3 CUSTOMERS    A00173
           609 SALES        A00173 I20981
            20 INVENTORY           I20981
           610 SALES        A00173 I00798
            22 INVENTORY           I00798
           611 SALES        A00173 I00161
            21 INVENTORY           I00161
             1 CUSTOMERS    A05072
             1 SALES        A05072 I01001
             1 INVENTORY           I01001
             6 SALES        A05072 I00029
            19 INVENTORY           I00029
            10 SALES        A05072 I01280
             3 INVENTORY           I01280
In most cases, the /R output is adequate for viewing the hierarchy. However, with the addition of RIGHT OUTER JOIN and FULL OUTER JOIN options to the ddlRelate() API function, the resulting hierarchies become more complex.

The ddlRpr() /H option can be used with or without the /R option. The ddlRpr() /H option output is prefixed to the data display for each record. When both the /R option and the /H option are present, the /R information is displayed before the /H information.

The ddlRpr() /H information can be represented symbolically as:
      . <absolute hierarchy level>
      . <begin frame flag> [+]
      . <end frame flag> [-]
      . <hierarchy restore level>

The <absolute hierarchy level> is a single digit [except when the max hierarchy level is greater than 9].

The remaining items coincide with the additional hierarchy information that is returned inctl->Ans3 of the ddlLookRec() API function. They are present only if the ddlLookRecFlFrameInfo flag is present.

The presence of the <begin frame flag> [+] coincides with the presence of the ddlLookRecFlFrameStart flag.

The presence of the <end frame flag> [-] coincides with the presence of the ddlLookRecFlFrameEnd flag.

The <hierarchy restore level> is the boolean AND ofctl->Ans3 with ddlLookRecFlMask.
   Example 3:
      >>rpr/h/r a cust# item#
       
          Rec TableName    Hinfo Cust#  Item#
          --- ------------ ----- ------ ------
             3 CUSTOMERS    1+ 0 A00173
           609 SALES        2    A00173 I20981
            20 INVENTORY    3 -         I20981
           610 SALES        2+ 1 A00173 I00798
            22 INVENTORY    3 -         I00798
           611 SALES        2+ 1 A00173 I00161
            21 INVENTORY    3 -         I00161
             1 CUSTOMERS    1+ 0 A05072
             1 SALES        2    A05072 I01001
             1 INVENTORY    3 -         I01001
             6 SALES        2+ 1 A05072 I00029
            19 INVENTORY    3 -         I00029
            10 SALES        2+ 1 A05072 I01280
             3 INVENTORY    3 -         I01280

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.