Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do i load flat file to db2 table

1,158 views
Skip to first unread message

Rajagopal Krishna Raj

unread,
May 5, 1999, 3:00:00 AM5/5/99
to
Hi,
I have flat file with structure same as DB2 table.
How do I load data from this flat file to the DB2 table ?
Should I use a query to do it ?
If a utility is used to load data into the DB2 table, How do I interpret
spaces in the flat file as null in the DB2 table

Thanks
KrishnaRaj


Blair Kenneth Adamache

unread,
May 5, 1999, 3:00:00 AM5/5/99
to
If it's an IXF file, you can load it with syntax like this:

load from E:\IXF\ADDRESS.IXF of ixf insert into ADDRESS

import is another choice:

import from E:\IXF\ADDRESS.IXF of ixf replace_create into ADDRESS

Mark Arnold

unread,
May 6, 1999, 3:00:00 AM5/6/99
to
What platform? How you do this on UDB will be somewhat different than OS/390,
etc...


In article <37303E98...@softhome.net>,


Rajagopal Krishna Raj <krish...@softhome.net> wrote:
> Hi,
> I have flat file with structure same as DB2 table.
> How do I load data from this flat file to the DB2 table ?
> Should I use a query to do it ?
> If a utility is used to load data into the DB2 table, How do I interpret
> spaces in the flat file as null in the DB2 table
>
> Thanks
> KrishnaRaj
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Rajagopal Krishna Raj

unread,
May 6, 1999, 3:00:00 AM5/6/99
to
Hi,
This load is on OS/390, I have the flat file as a Physical Sequential file (PS)
Thanks
Krish

Mark Arnold

unread,
May 6, 1999, 3:00:00 AM5/6/99
to
You have several options for loading on OS/390:

1.) Write a program that reads the file, then inserts the record.

2.) Use IBM's load utility (DSNUPROC).

3.) Use a third part utility (i.e. BMC LoadPlus)

To use either utility, you need a control card which defines the table and
the type of load (delete and replace all vs. add new) as well as the input
file. The control card also can be used to say "If this is .... then it
should be null". I can send you sample JCL if you need me to. Writing a
program (option 1) allows you more flexibility in reformating the file, but
takes somewhat longer...

I can send you sample JCL for a load job if you would like. Contact me at
Mark....@BNSF.com

In article <37319089...@softhome.net>,

CLB

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
We have a as/400 model 170...this procedure may be different on your machine
but the philosophy would be the same...
1. create a Physical source file ie. qddssrc in your development library.
2. define your flat file to DDS, compile to data file.
3. the copy physical file to the new db file (as described in your DDS)
using the replace data parameter, also tell the copy to ignore data format
checking. (needed if you have null (hex 00) to spaces (hex 40).
This worked great for us!
Good luck.
Blair Kenneth Adamache wrote in message <373082C2...@ca.ibm.com>...

>If it's an IXF file, you can load it with syntax like this:
>
>load from E:\IXF\ADDRESS.IXF of ixf insert into ADDRESS
>
>import is another choice:
>
>import from E:\IXF\ADDRESS.IXF of ixf replace_create into ADDRESS
>
0 new messages