By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,778 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,778 IT Pros & Developers. It's quick & easy.

Loading data from a .DAT file

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

"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

P: n/a
"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.