How to load data from flat file onto db2 table

IBM's flagship relational database management system
savitha_y
Posts: 18
Joined: Mon May 11, 2009 3:05 pm
Skillset: jcl,cobol,cics,db2
Referer: google

How to load data from flat file onto db2 table

Postby savitha_y » Thu May 28, 2009 2:39 pm

Hi,

I have a requirement where i need to load the data on db2 table from flat file using load utility.

the flat file contains 3 date fields which may contain null values

when i load the data from file it ended with an I/O error ...

Could any one please suggest, how to convert the flat file into table loadble format i.e. if date field have spaces it should load table field with null values else with the date value.

Thanks.

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

Re: How to load data from flat file onto db2 table

Postby dick scherrer » Fri May 29, 2009 1:39 am

Hello,

Keep in mind that there is no such thing as a "null value". NULL is a condition not a value. When working with NULLs, you need to allow for the "null-indicator".

If would be rather trivial to write a bit of code to to read the flat file, move the values to host variables and INSERT the rows once the "formatting" had been done (i.e. setting the null-indicator for those rows with spaces in the date field).
Hope this helps,
d.sch.

User avatar
arcvns
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Skillset: COBOL, JCL, SYNCSORT, VSAM, DB2
Referer: Nobody
Location: India
Contact:

Re: How to load data from flat file onto db2 table

Postby arcvns » Tue Jun 02, 2009 11:09 pm

Were you able to load your table?
Arun


  • Similar Topics
    Replies
    Views
    Last post