Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load mainframe db2 from Excel spreadsheet

Status
Not open for further replies.

MarcLodge

Programmer
Feb 26, 2002
1,886
GB
Hi all,
I've got quite a bit of data in some Excel spreadsheets that I want to export to a mainframe db2 system. I can transfer flat files backwards and forward to the mainframe and then either load via a spufi or a bespoke program, but I wonder if anybdoy has any better ideas.

I can get data off the db2 system and into the spreadsheets via ODBC but I can't get it to go the other way.

Anybdoy ever come up with a clever way to achieve this?

Marc
 



ADODB using UPDATE SQL or using the recordset execute (I think) method.

Are you running VBA in Excel?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip, you'll see I have a further problem if you visit the MS Office forum, but I didn't think it was appropriate to post what was basically an excel problem in this forum.

I'm not running VBA in excel, although I have experience of many years ago of doing this in an Access DB. I could probably find the code on an old laptop somewhere, but I'm not sure how I would convert this from access to excel.

Do you have any pointers of reference sites that I can look up?

Marc
 


Yes, I answered that thread, but did not make the association.

The db related code is almost identical. The Access or Excel objects are different.

Depending on your choice, I'd suggest re-posting your question in either forum705 or forum707.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
This may be more pedestrian that you want but has worked for many requirements . . .

Save the spreadsheet data to a text file, upload the text file to the db2 mainframe (this is mainframe db2?) , load into db2 using whatever is standard for that environment.

After the first manual run, this can be automated for the most part. It can also be cloned for other tableloads.

 


I can transfer flat files backwards and forward to the mainframe and then either load via a spufi or a bespoke program, but I wonder if anybdoy has any better ideas.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I have used MS Access to maintain DB2 Mainframe tables.

I use an IBM DB2 connection because our DB2 Tables are on Big Blue Equipment

You could load your Excel Spreadsheet into Access, then set up an Update Process in Access - If you know MS Access :)
 
marc, ADODB is really the way to go. if this goes to a db2 table directly, then fixed size of variables should normally be less important as it should probably be trimmed anyway before loading into the db2 table.

However if even on the db2 table you need the trailing spaces, then even that can be easily accomplished on the vba code.


If you are doing this on the machine that at the moment contain your ODBC connection to the mainframe, then the same connection setup can be used with OLEDB. If you get stuck with this on VBA, if you can give me a sample of one of your extracts OUT of the mainframe using ODBC. just code with connection string, and a straight SQL out of one of your tables would be enough for me to give you a sample of putting data back.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top