The fastest possible way is to use a compiled language, with this logic flow:
Have a large, static array of record buffers
Open the input as a streamed (Unix or OS/400) or double-buffered (zOS) file.
Loop
Read a record
Leave the loop if EOF
Validate the record
If passed
Store its values into the array and increment the count
If the count is the same as the number of records the array can hold
Do a block insert of the array into the table
Set the count back to zero
End-if
Else
Generate an appropriate error message
End-if
End-loop
Close the input file
If there were errors
Roll back
Else
If there are records in the array
Do a block insert of the used portion of the array into the table
End-if
Commit
End-if
—
Sheldon Linker (sol@linker.com)
Linker Systems, Inc. (www.linkersystems.com)
800-315-1174 (+1-949-552-1904)
Discuss This Question: