468,257 Members | 1,475 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

Loading data from a .DAT file

Hello, I need some help with a small problem. I have a fixed length
format dat file with the first and last lines been the header and
trailer file information. The header, body and trailer information
have each their own fixed format lengths. What need to know is if
there is a utility or command within DB2 UDB version 8.1 that when the
file is been loaded that it can load the header body and trailer
informatio into 3 separate tables??? TIA!

WofD
Nov 12 '05 #1
2 6812

"Thanos" <in******@hotmail.com> wrote in message
news:ea*************************@posting.google.co m...
Hello, I need some help with a small problem. I have a fixed length
format dat file with the first and last lines been the header and
trailer file information. The header, body and trailer information
have each their own fixed format lengths. What need to know is if
there is a utility or command within DB2 UDB version 8.1 that when the
file is been loaded that it can load the header body and trailer
informatio into 3 separate tables??? TIA!

I'm still running DB2 UDB V7.2 for Linux/Unix/Windows so this information
comes from the V7.2 manuals; V8.1 may have new features that would allow it
to handle the .DAT file that you describle. Consult the Data Movement
Utilities manual for your platform to be absolutely sure.

In V7.2, the Load and Import utilities both expect all records of the input
files to have the same layout; I can't think of any way that they can parse
the input file so that they can distinguish between the header, detail, and
trailer records. Assuming this is true for V8.1, I think you will need to
spit your .DAT file into the three record types manually (or via a script or
batch program that you write yourself) first, then write a separate Load or
Import statement for each of the three files.

Rhino


Nov 12 '05 #2
"Rhino" <rh****@NOSPAM.sympatico.ca> wrote in message news:<GD*********************@news20.bellglobal.co m>...
"Thanos" <in******@hotmail.com> wrote in message
news:ea*************************@posting.google.co m...
Hello, I need some help with a small problem. I have a fixed length
format dat file with the first and last lines been the header and
trailer file information. The header, body and trailer information
have each their own fixed format lengths. What need to know is if
there is a utility or command within DB2 UDB version 8.1 that when the
file is been loaded that it can load the header body and trailer
informatio into 3 separate tables??? TIA!

I'm still running DB2 UDB V7.2 for Linux/Unix/Windows so this information
comes from the V7.2 manuals; V8.1 may have new features that would allow it
to handle the .DAT file that you describle. Consult the Data Movement
Utilities manual for your platform to be absolutely sure.

In V7.2, the Load and Import utilities both expect all records of the input
files to have the same layout; I can't think of any way that they can parse
the input file so that they can distinguish between the header, detail, and
trailer records. Assuming this is true for V8.1, I think you will need to
spit your .DAT file into the three record types manually (or via a script or
batch program that you write yourself) first, then write a separate Load or
Import statement for each of the three files.

Rhino


DB2 has API, you can write your own program to handle this.
If easy, why not split your .DAT file into 3 and do the import seperately.
DB2 import/export/load/move utility cannot do this directly
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by E | last post: by
reply views Thread by anonymous | last post: by
reply views Thread by John Samson | last post: by
5 posts views Thread by Bill Q | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.