With my tool, you can choose the delimiter by parameter
(some like semicolon instead of comma, because in some
European countries the comma is used instead of decimal point
to separate the decimal fraction - tab is possible too, of course),
and char fields are enclosed into quotes (or apostrophes),
if necessary. ExCel etc. deal with all this, it's tested.
Furthermore, you can choose if you want column headings or
not. If you have column headings (derived from the SQL result),
you can later use those headings to reference your columns, if
you use the CSV to do updates on the DB again. If not, you have
to specify the numeric position of the column ... in any case, you
have to tell the tool the data type in this case, because it does
no pre scan of the file, as ExCel does. But this is for the load
situation only; for unload, it's as easy as
unlddn csvhead := unload qualif.db2table;
or
unlddn csv := select * from qualif.db2table where ...;
Kind regards
Bernd
Am 26.02.2015 um 04:11 schrieb Paul Gilmartin:
On Wed, 25 Feb 2015 17:42:16 -0600, Tony's Outlook via Mozilla wrote:
I'd certainly prefer zOS/batch/DFSORT. Unload the table to FB disk, use
DF/SORT to insert x'05'(tab) or comma(CSV) where desired. I do this
quite often to create a flat file that will eventually go back to MS
excel/access. Millions of records? No big deal.
And suppose your data contain commas in some column, in some rows
but not all? E.g. "Babonas, T." Well, the designers should have split
those fields into separate columns, but sometimes they don't. Choose
a different separator? If you don't know a priori which character meets
that requirement you must do a preliminary scan to find one. And if
you find none you must establish a convention for escaping metacharacters.
I suppose DFSORT can do all this. (Hmmm... Has anyone proven that
DFSORT is Turing-complete? Or that it isn't?)
Faced routinely with such a problem given a .xlsx file, I open it with
LibreOffice and export as HTML, which guarantees that its delimiter
tokens don't appear among the output data.
Bernd probably has an effective solution. LibreOffice doesn't batch
at all well.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN