...
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Overview
You can use the COBOL Copybook Formatter Snap to format a JSON file into a flat file based on the specified COBOL structure(s). COBOL programs can then format the input data to process the output.
...
Expand | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||
On running When the pipeline is run, the Snap produces a binary output representing the input documents formatted based on according to the specified COBOL structure. Input Document StructureThe input document structure must exactly map to the COBOL structure or structures as follows:
Note that often, there is a requirement to supply data as a hexadecimal value. This can be achieved by providing the value of a field in the format of x’012345’, but please note:
|
Snap Type
The Copybook Formatter Snap is a Format type Snap that formats a flat-file based on the specified COBOL structures.
Prerequisites
None.
Support for Ultra Pipelines
Does not support Ultra Pipelinespipelines.
Limitations
The input document structure is very rigid and must map to the format of the provided COBOL structures.
Known Issues
None.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| The input to this snap must be structured JSON documents that match the structure of the COBOL structures. |
Output | Binary |
|
| The output from this Snap is a flat binary file containing the data that has been mapped from the input document to the COBOL structure(s) provided as part of the configuration. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
|
Learn more about Error handling in |
Snap Settings
Info |
---|
|
Field Name | Field Type | Description | |
---|---|---|---|
Label* Default Value: Cobol Copybook Formatter | String | Specify the name for the Snap. You can modify the default name to be more specific and meaningful, especially if you have more than one of the same Snaps in your pipeline. | |
Copybooks* | Use this field set to define the Copybooks to use. | ||
Copybook File*
Default Value: N/A | String/Expression | Specify the Copybook file which that describes the data. Alternatively, click the upload icon to browse and upload the desired required copybook file. | |
Copybook Split*
Default Value: SPLIT_NONE | String/Expression/Suggestion | Select the option to split the copybook Copybook for processing. The available options are:
| |
Organization*
Default Value: IO_DEFAULT | String/Expression/Suggestion | Specify the type of file organisation organization for the data payload. Alternatively click the Suggestion icon to fetch a list of file organisation types and select the desired organisationorganization.
Learn more about Organization types. | |
Dialect*
Default Value: FMT_MAINFRAME | String/Expression/Suggestion | Specify the COBOL dialect. The available options are:
The selected dialect determines how the parser deals with binary information in the input file. | |
Encoding*
Default Value: UTF8 | String/Expression/Suggestion | Specify the format for encoding the input data. Any supported Java encoding is available for use. Some common code pages to be used:
| |
Configure error processing | Configure the action the Snap must take when an error occurs. | ||
Set maximum acceptable number of errors | Integer | Set the maximum number of acceptable errors that can occur before the Snap terminates. Zero (0) indicates no limit on errors that can be issued. | |
Configure field error processing | Use this field set to configure the Snap's action when an error ocucurs occurs for each field. | ||
Field Name | String/Expression/Suggestion | Specify or select the full name (this must include structure for uniqueness) of the COBOL field being configured. | |
Error processing configuration* | Expression/Dropdown list | Select or set the action the Snap must take when an error occurs when processing:
| |
Default value for field | String/Expression | Specify the default value that will be output for a field. | |
Debugging configuration | Configure the debugging properties. | ||
Name of only structure to output | String/Expression/Suggestion | Specify or select the name of the only structure for which data is to be sent to the output. Data for any other structure will be ignored and is not sent to the output. | |
Ranges of records to be output | Specify one or more ranges of records to be output. | ||
Low record for range | String | Specify the first record in the range to be passed to the output.
| |
High record for range | String | Specify the last record in the range to be output. | |
Set character to initialize each record | Integer | Specify the number (optional) to set each record to the output. The field is specified as a numeric value from 0 to 255 inclusive and represents the decimal value of the character to be used. For example:
This has performance implications so we recommend you to use only if required. | |
Snap Execution
Default Value: Validate & Execute | Dropdown list | Select one of the three modes in which the Snap executes:
|
Additional Information
The output from this Snap will be a flat binary file containing the data that reflects the COBOL structure(s) provided as part of the configuration. This file will consist of data that has records with the following formats. For the records to be written correctly, you must configure the correct record type processing for the records to be processed accurately. For more information about the Organization types, refer to the Organization field in the Snap Settings table:
...
Character data: This data should have a code page that you must correctly specify in your configuration.
Binary data: These are binary numeric values that will have a specific endianness (the order in which the bits are transmitted over a communication channel) depending on the platform from which they have come.
Big Endian generally comes from older mainframe platforms (z Series, i Series, Solaris etc.) and is where the high order byte of the binary value is the most significant byte.
Little Endian generally comes from newer platforms (x86, x86-64 and so on) and is where the low order byte of the binary value is the most significant byte.
Troubleshooting
Error | Reason | Resolution |
---|---|---|
Account validation failed. | The pipeline ended before the batch could complete execution due to because of a connection error. | Verify that the Refresh token field is configured to handle the inputs properly. If you are not sure when the input data is available, configure this field as zero to keep the connection always open. |
Examples
Process a Single JSON-formatted Record
This example demonstrates how to use a single COBOL Structure defined with a JSON format being processed from JSON to COBOL formatted output for postprocessing by a downstream snap.
...
The pipeline is now ready to process the file and produce the formatted document. Following pipeline validation, you can preview the output:
...
Process multiple JSON formatted records
This example demonstrates how to use a multi-record COBOL structure defined with a JSON format processed from JSON to COBOL format output using the JSON Parser and Copybook Formatter Snaps
...
On validation, the pipeline processes the file and produces the formatted document.
...
Process JSON formatted records with header and trailer details
This example demonstrates how to process the COBOL structure containing header and trailer definitions defined in a JSON format.
...
On validation, the pipeline processes the file and produces the formatted document.
...
Downloads
Info |
---|
|
Attachments | ||||
---|---|---|---|---|
|
Snap Pack History
Expand | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
Related Content
Snap Support for Ultra Working with Pipelines