Given the following comma-delimited file: names.csv (consisting of first
name, last name, age), with age missing on record #2:
John,Doe,40
Jane,Doe,
Tom,Doe,25
And given the target AS/400 physical file:
A R FAMREC
A FIRSTNAME 10A
A LASTNAME 20A
A AGE 3S 0
On CPYFRMIMPF when I use the new RPLNULLVAL parameter with a value of
*FLDDFT, the result of the copy is 3 records with all fields initialized to
default values. What I expected to see was all the fields from the
comma-delimited file mapped to the corresponding database file fields, with
the exception of the 2nd record - which should contain a 0 in the AGE field
(the default value)
Can anybody tell me what I am doing wrong?
Thanks,
David
In article <391c2949$0$70...@wodc7nh7.news.uu.net>,
"David Wilson"
<Remove_This....@StrategicFulfillment.com
Sent via Deja.com http://www.deja.com/
Before you buy.
>> On CPYFRMIMPF when I use the new RPLNULLVAL parameter with a
value of *FLDDFT, the result of the copy is 3 records with all fields
initialized to default values. <<
...I agree with you. What a nonsense. Surely the Keyword is
malfunctioning and a corrective PTF needs to be issued?
IMO this is a long standing problem... the AS400's inability to
deal with one of the most trivial file formats in existance. The
humble CSV. At last the CPYFRMIMPF command nicely handles most of the
CSV conventions... what a shame about the nulls.
And do you see how it leaves all those trailing blanks under
CPYTOIMPF? "You ","have ","to ","laugh " :)
Mark
--
Kent Milligan, DB2 & BI team
PartnerWorld for Developers, AS/400
km...@us.removethis.ibm.com GO HAWKEYES!!
(opinions stated are not necessarily those of my employer)
SF62686 for V4R4
>> This was recently fixed. The PTF that enabled this enhancement
is now superceded.
SF62686 for V4R4 <<
...just the job, thanks.
Mark
>> This was recently fixed. The PTF that enabled this enhancement
is now superceded. <<
Excellent... now what are the chances of a PTF to fix up CPYTOIMPF?
Lose those trailing blanks when creating a *DLM file, and something to
control the authority on the created file (currently, *PUBLIC EXCLUDE
is your only choice).
These two commands (CPYFRMIMPF, and CPYTOIMPF) are incredibly
useful. It may not be Bleeding Edge but in the real world this is how
we transfer data all the time. :)
Mark
Is this enhancement available at V4R3?
Cheers,
Simon Brunning
TriSystems Ltd.
sbru...@trisystems.co.uk
The opinions expressed are mine, and are not necessarily those of my
employer. All comments provided "as is" with no warranties of any
kind whatsoever.
--
Kent Milligan, DB2 & BI team
PartnerWorld for Developers, AS/400
km...@us.removethis.ibm.com GO HAWKEYES!!
(opinions stated are not necessarily those of my employer)