Render Copybook Data Activity

This activity accepts data from other activities and produces data according to the COBOL copybook held in a selected Copybook connection. The COBOL data can then be passed to an application. Flogo flows can use other activities to carry out the data delivery.

Configuration

The fields on the Settings tab of this activity are described as follows:

Field Description
Copybook The Copybook connection that contains a copybook.
Big Endian The byte order of the incoming data. Select true to specify the byte order as Big Endian, for example, for IBM mainframes and certain UNIX platforms. Select false, if the byte order is Little Endian, for example, for Microsoft Windows and certain UNIX platforms.
Character Set The character-set encoding for the string values in the rendered data except for items with USAGE DISPLAY-1, also affects the rendering of zoned decimal values. For more information, see Handling of Zoned Decimal Items.

Some of the available character sets are multi-byte, for example UTF-8. If you select a multi-byte character set, it will be used to convert strings to binary content. However the item’s binary length is based on its PICTURE assuming one byte per character.

Character Set selection does not alter the binary offsets and lengths of items in the copybook.

Character Set for DISPLAY-1 Items The character-set encoding for items with USAGE DISPLAY-1. Binary length of such item’s is based on their PICTURE clause assuming two byte per character. However, you can choose a single-byte or a variable character set and it is used to render text.

Character Set for DISPLAY-1 Items selection does not alter the binary offsets and lengths of items in the copybook.

Multiple Records

The field that instructs the activity to render multiple copybook records.

If Multiple Records is selected, the schema of the Input property data becomes an array. Otherwise the schema is an object that contains a single instance of the copybook data.
Record Delimiter The field that specifies the delimiter between records in the output data in case of a selected Multiple Records field. You can specify the following valid delimiter types:
  • None: Specifies that a new record begins directly after the previous record ends. No bytes separate the records.
  • New Line: Specifies that a new-line character (hex value 0A) separates the records in the output.
  • Carriage Return: Specifies that a Carriage Return character separates (hex value 0D) the records in the output.
  • Carriage Return/Line Feed: Specifies that a carriage-return character followed by a New Line character separates the records in the output (byte sequence 0D 0A).

You can specify your own delimiter sequence using recordDelimiter on the Input tab of the activity.

Truncate Multibyte Strings The field that specifies whether to truncate long strings and is applicable only if you have selected a multibyte character set. For DISPLAY items, the binary length is equal to the number of characters. If you configure the activity to use a multibyte character set, the binary representation of a string might become longer than the allocated length. In that case
  • If you select this field, the activity truncates the binary representation at the nearest character boundary to ensure that the activity does not throw an error and that the allocated length is never exceeded.
    Note: Exercise caution when selecting this field. Even though data truncation occurs at a character boundary, the truncation may cause an undesired content change for certain multibyte character sets.
  • If you do not select this field, the activity throws an error.
Filler Character The field that specifies the filler character used for text padding or layout gaps. You can choose either NULL (a byte with value zero) or Space as the fill character; NULL is the default.

When you select Space, the exact byte value depends on the Character Set setting of your activity.

For more information, see Item Initialization During Rendering.

Default Numeric and DATE Items to This field specifies how the binary data is initialized for numeric or DATE FORMAT items that are not specified in the input mapping. The options are as follows:
  • Type Defaults: Numeric and Date items are initialized differently.
    • Numeric items are initialized with a numeric value 0 and are rendered according to the PICTURE and USAGE clauses, as well as settings of the Copybook connection and Render activity.

    • DATE items are initialized with a default date 0001-01-01, which is rendered according to the PICTURE, USAGE clauses, as well as settings of the Copybook connection and Render activity.

  • LOW-VALUES: All numeric and DATE items are initialized with zero bytes, regardless of the copybook or any other settings.

For more information, see Item Initialization During Rendering.

ASCII Zoned Format You can use this field to select a specific ASCII Zoned format to be generated. Use this field when the Character Set field or forceCharacterSet field is set to a character set that belongs to the ASCII family.
  • Strict: Generates Strict ASCII zoned decimal format.
  • Modified: Generates Modified ASCII zoned decimal format.

The input field asciiZonedFormat acts as a runtime override of this field. For more information, see Handling of Zoned Decimal Items.

IBM i Sign Nibbles If it is selected, this field instructs the activity to render the IBM i flavor of zoned and packed decimal items. If it is not selected, zOS flavor is generated.

For more information, see Sign Nibbles in Zoned and Packed Decimal Items.

Input

The Input tab has the following fields:

Field Description
forceCharacterSet A runtime override for the Character Set setting. For details, see the description of the field Character Set in the section Render Copybook Data - Configuration.
forceCharacterSetDisp1 A runtime override for the Character Set setting for DISPLAY-1 Items. For details, see the description of the field Character Set for DISPLAY-1 Items in the section Render Copybook Data - Configuration.
recordDelimiter A delimiter to be placed between copybook records when Multiple Records is selected. If specified, it overrides Record Delimiter specified on Settings tab.

This is a Base64 encoded binary value.

asciiZonedFormat

This is a runtime override for the ASCII Zoned Format field of the Render activity. It is used to select a specific flavor of ASCII Zoned Decimal format. Use this field when the Character Set field or forceCharacterSet field is set to a character set that belongs to the ASCII family. You can use these values:

  • strict: Generates Strict ASCII zoned decimal format.
  • modified: Generates Modified ASCII zoned decimal format.
data The json data to be converted to a COBOL binary sequence. If Multiple Records is selected it contains an array of records or a single record otherwise. The schema for a record is generated by the selected Copybook connection to reflect the copybook contents.

Output

The Output tab has the following fields:
Field Description
bytes A base64 encoded byte sequence generated from JSON input data. This sequence can be consumed by a COBOL program.
noOfRecords Number of records rendered.

Item Initialization During Rendering

In most cases, you supply values to a Render activity through mapping. You are not required to always supply a value using mapping.

When you skip a value, the following may happen:

  • Parse checks for any initial value supplied in a VALUE clause in the copybook and renders it if it is present.
  • The binary data is formed according to the policies described in the following table. This table also describes any padding that results in case of insufficient data length or layout gaps.
Item Type Action
COBOL text items (PIC X or G) The Filler setting of the activity is used to initialize missing items or pad shorter strings.
Padding within a REDEFINE group If a REDEFINE group consists of items on unequal byte length, the Filler settings is used to pad the shorter items.
Gaps due to SYNC clause and top-level item placement on the double-word boundary. Filler setting used to fill the gaps.
@binary items The Filler setting is used to initialize missing items or pad shorter values.
Items with DATE FORMAT The setting Default Numeric and DATE Items to, is in effect. When Type Defaults is selected, the default date 0001-01-01 is rendered. Otherwise a zero byte is used as a filler.
External floating point items The setting Default Numeric and DATE Items to, is in effect. When Type Defaults is selected, the algebraic value 0 is rendered according to the copybook specifics and activity settings. Otherwise a zero byte is used as a filler.
Numeric edited items The setting Default Numeric and DATE Items to, is in effect. When Type Defaults is selected, the algebraic value 0 is rendered according to the copybook specifics and activity settings. Otherwise a zero byte is used as a filler.
Zoned and packed decimal items A zero byte is used as filler.
COMP-1 and COMP-2 items A zero byte is used as filler.