<library>

The <library> element contains an arbitrary number of <block> statements that can be used within a macro.

Description

The <insert> element is used to bring individual <block> statements into a macro. The <import> element is used to make an entire <library> available within a macro.

Syntax

<library>
    <block>A block of Macro Language code</block>
    <block>Another block of Macro Language code</block>
</library>

Example

In this example, assume the "current" table is pub.demo.retail.item and the objective is to average any columns with numeric values. The <library> tag is used to contain a <block> statement. The <insert> statement is used to make the <block> available in a macro.

<library>
<block name="storeselect" type="all">
    <if test="{@type='all'}">
      <then>
        <note>all stores selected</note>
      </then>
      <else>
       <sel value="store=4"/>
      </else>
    </if>
   </block>
</library>

<base table="pub.demo.retail.item"/>
<insert block="storeselect"/>