DataLoader/MX Reference Manual (G06.24+)

Specifying File-Related Options for DataLoader/MX
DataLoader/MX Reference Manual525872-002
4-5
CSV
Data records can be continued onto multiple lines by putting the ampersand (&}
character (or the CONTCHAR) at the end of each line of the record except the last.
The data record continuation is not related to any continuation used in the record
layout description. Blank lines can appear between the lines of a continued record
and are ignored. If you use the CONTCHAR, it replaces the ampersand (&). See
record 2.
CHAR fields do not have to be enclosed within quotes. The comma (or the
SEPCHAR) signals the end of the field. See record 1.
A CHAR field can be shorter than its specification. The value is left-justified and
blank-padded in the internal record. See record 1.
A comma (or the SEPCHAR) can be included in a CHAR field by enclosing the
entire field in quotes. See record 2.
The quotes used to enclose a CHAR field can be either single quotes (') or double
quotes ("). See record 2.
A quote can be included in a CHAR field by using two adjacent quotes of the type
that is used to enclose the field or by enclosing the field in the other type of quote.
The included quote should not be doubled when the other type of quote is used to
enclose the field. See record 3.
The output file must begin with a specification list like the one that starts input CSV
files. DataLoader/MX reads this specification list and uses it to format output records
into comma-separated value records appended to the file. The translation works
similarly to input, except that enclosing the field specifier in quotes of either type
causes the output field to be enclosed in quotes of the same type.
Example
In this example, CSV is used to control output:
$ dataload -i="out(dump)" -o="csvout(csv<sepchar=;,contchar=+\
,maxrecsize=85>)"
The specification fields direct DataLoader/MX to replace the comma separation
character with a semicolon (;), to change the continuation character from an
ampersand (&) to a plus sign (+), and to put a maximum of 85 characters on a line.
In this example, CSV is used for output of status messages:
$ dataload -i="dtldata(text)" -o="outfile(text)" \
-s="500<CSV=csvstats>"
500 input records are processed between status messages. The messages are in a
comma-separated values (CSV) format suitable for loading into a spreadsheet for
analysis or graphical display. The CSV status information is written to a file called
csvstats. See the -S parameter on page 3-8 for more details.