You can configure the Mainframe Connector transcoder's CSV formatting by adding the required configuration in a JSON file,
and specifying this file using the --input-parameter csv-dialect=DataPath
option with the qsam encode
or qsam decode commands.
You must define the CSV configuration as specified in section CsvConfiguration.
This page describes the various CSV parameters you can configure as input parameters for transcoding.
The CsvConfiguration object contains all CSV encoder and decoder configuration options.
CsvConfiguration
The CsvConfiguration object lets you configure the CSV decode and encoder configuration.
| JSON representation |
|---|
{ "binary_data_encoding": enum ( |
| Fields | |
|---|---|
binary_data_encoding |
Specify the way in which Mainframe Connector encodes or decodes binary data. Valid values are hexadecimal, base64, or hex. The default value is base64. |
date_format |
Specify the format for the date. The default format is |
delimiter |
Specify the character to use to separate fields. |
header |
Set this to true if you want the first row to contain column names instead of actual data. |
line_terminator |
Specify the character to use to separate lines. |
list_end_delimiter |
If |
list_start_delimiter |
If |
null_representation |
Specify the string that represents a null character. |
quote |
Specify the quote character. |
quote_escaping |
Specify the escape character. |
quote_mode |
Specify the quoting behavior. The default value is |
struct_end_delimiter |
If |
struct_start_delimiter |
If |
support_list |
Set to true if you want Mainframe Connector to support lists in CSV. |
support_struct |
Set to true if you want Mainframe Connector to support structs in CSV. |
timestamp_format |
Specify the format for the timestamp. The default value is |
Enums
BinaryDataEncoding
Specify the way in which Mainframe Connector encodes or decodes binary data. Valid values are hexadecimal, base64, or hex. The default value is base64.
| Enums | |
|---|---|
BASE64 |
Encodes binary data into an ASCII string. |
HEX |
Encodes binary data into hex (\x format) or escaped octal. |
HEXADECIMAL |
Encodes binary data into the hexadecimal (0x format) or raw binary. |
QuoteMode
Defines quoting behavior.
| Enums | |
|---|---|
ALL |
Quotes all fields. |
ALL_NON_NULL |
Quotes all non-null fields. |
MINIMAL |
Quotes fields which contain special characters such as a the field delimiter, and quotes character or any of the characters in the line separator string. |
NONE |
Never quotes fields. When a delimiter occurs in the data, the printer prefixes it with the escape character. If the escape character is not set, format validation throws an exception. |
NON_NUMERIC |
Quotes all non-numeric fields. |
WriteHeaderMode
Defines the behavior of writing the CSV header.
| Enums | |
|---|---|
ALWAYS |
Always write the CSV header. |
NO |
Doesn't write the CSV header. |
YES |
Writes the CSV header only if data is present. |