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.
How to load data from flat file onto db2 table
- 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
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).
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.
d.sch.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
How to identify ASM load modules in a load lib
by Misha786 » Thu May 16, 2024 7:08 pm » in Assembler - 0
- 2357
-
by Misha786
View the latest post
Thu May 16, 2024 7:08 pm
-
-
-
How to import a ZFS data file into VSAM catalog
by danik56 » Tue Nov 23, 2021 10:29 pm » in VSAM/SMS - 0
- 3446
-
by danik56
View the latest post
Tue Nov 23, 2021 10:29 pm
-
-
-
Find the version of a cobol program through its load module
by vinigim » Fri Oct 30, 2020 3:16 am » in IBM Cobol - 5
- 5154
-
by chaat
View the latest post
Sat Nov 07, 2020 8:40 am
-
-
- 0
- 3077
-
by dylson
View the latest post
Sat Aug 01, 2020 11:09 pm
-
- 5
- 2767
-
by sergeyken
View the latest post
Thu Feb 25, 2021 8:19 pm