MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mass Insertion to a DB2 Table

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Mon Mar 21, 2005 8:37 am    Post subject: Mass Insertion to a DB2 Table Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Mar 21, 2005 8:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Tue Mar 22, 2005 8:28 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Mar 22, 2005 8:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group