View previous topic :: View next topic |
Author |
Message |
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Mon Mar 21, 2005 8:37 am Post subject: Mass Insertion to a DB2 Table |
|
|
I have an Input file which holds around 2000 records. The input will be similar to the one below.
Code: |
123456701000281993-01-1512345678901234567890123456789012345678909999-12-310001-01-01
|
Only the first 9 cols keep changing. Basic requirement is I have to do a mass insert to a DB2 table. I am looking for a way to create a JCL that will read the Input file and create an output file having an INSERT statement for all the rows in the Input file.
Code: |
INSERT INTO DBA1.TABLE1 VALUES ("1234567","01","00028","1993-01-15","12345678901234567890","12345678901234567890","9999-12-31","0001-01-01").
|
Can someone help me to get a row like above. So that I can run the file from JCL and do the mass insertion.
Any Ideas to achieve this other than using JCL is also most welcomed. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Mar 21, 2005 8:57 am Post subject: |
|
|
sakreg,
Why don't use LOAD RESUME with the file? If for some reason you cannot use it then post your table layout and position of the fields in the file and I will show you an example to do it.
Btw Do you have File-aid at your shop?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Tue Mar 22, 2005 8:28 am Post subject: |
|
|
Thanks for your Suggestion kolusu.
I thought of that way but that would be at the DB2 level which will have to involve DBA as the table space would go to pending copy update status as 'Y' and there would be also a need to do Re-Org and I am looking for a solution at the DML level.
Basically what I am looking forward is to create SPUFI from the inputfille. And instead of manually writing a SPUFI (which might create a human err), I am looking for a JCL that executes the whole bunch of INSERT stmts in the file after manipulting it to the way how an INSERT DML looks.
This I have to load in Prod. So I do not want to mess around with DB2 utilities . Doing using DML is what I am looking for.
Any Idea of how I can go ahead using DML? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Mar 22, 2005 8:59 am Post subject: |
|
|
Quote: |
Any Idea of how I can go ahead using DML?
|
Sakreg,
I guess you missed reading the following in my prior post.
Code: |
If for some reason you cannot use it then post your table layout and position of the fields in the file and I will show you an example to do it.
Btw Do you have File-aid at your shop?
|
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|