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 |
---|
{ "null_representation": string, "header": boolean, "quote_escaping": string, "quote": string, "delimiter": string, "line_terminator": string, "support_list": boolean, "list_start_delimiter": string, "list_end_delimiter": string, "support_struct": boolean, "struct_start_delimiter": string, "struct_end_delimiter": string, "binary_data_encoding": enum ( |
Fields | |
---|---|
null_representation |
Specify the string that represents a null character. |
header |
Set this to true if you want the first row to contain column names instead of actual data. |
quote_escaping |
Specify the escape character. |
quote |
Specify the quote character. |
delimiter |
Specify the character to use to separate fields. |
line_terminator |
Specify the character to use to separate lines. |
support_list |
Set to true if you want Mainframe Connector to support lists in CSV. |
list_start_delimiter |
If |
list_end_delimiter |
If |
support_struct |
Set to true if you want Mainframe Connector to support structs in CSV. |
struct_start_delimiter |
If |
struct_end_delimiter |
If |
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 |
timestamp_format |
Specify the format for the timestamp. The default value is |
quote_mode |
Specify the quoting behavior. The default value is |
QuoteMode
Defines quoting behavior.
Enums | |
---|---|
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. |
ALL_NON_NULL |
Quotes all non-null fields. |
ALL |
Quotes all fields. |
NON_NUMERIC |
Quotes all non-numeric fields. |
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. |
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. |