Connecting Multiple Parse Activities
In real world applications, a binary buffer often consists of data whose layouts could be described in multiple copybooks. Sometimes the decision of which copybook to use next is made based on the data present. Control fields in REDEFINE groups offer a form of control but do not cover all patterns.
The most typical pattern is this:
- Two or more copybooks of different byte size are packed into an envelope message.
- Each copybook is preceded with an indicator field that determines which copybook layout follows.
- Layouts are different sizes, which makes it impossible to pack copybooks into a super-copybook with a REDEFINE clause.
To address this scenario, the Parse Copybook Data activity offers an option to return the remainder of the byte data, making it available to the next Parse activity. For example:

In this example, the byte output from the Render activity is processed by the ParseCopybookData1 activity. Because the first parse activity has the Return Remaining Bytes option enabled, the data is forwarded to the ParseCopybookData2 activity.

Typically, a small copybook is defined that describes the layout field. A separate Parse activity would read it and transition conditionally to a Parse for each respective copybook layout that is expected to follow.
- The
Return Remaining Bytes option is not automatically selected. It must be enabled using the check box in the General tab. Selecting the Return Remaining Bytes check box results in the addition of the
remainingBytes element to the parse output activity.
Enabling this feature for a copybook and returning a base64Binary back into the process incurs a performance cost. The cost is insignificant with small amounts of data, but large remainders slows performance.
- This feature is only available when the Input type specified for the Copybook Parse activity in the General tab is bytes.
- For simplicity, the Return Remaining Bytes check box is always selectable even when Multiple Records is also selected, and when selected it causes the remainingBytes element to be included in the parse output activity. However, when Multiple Records is selected, this element is always empty.