INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Load mainframe db2 from Excel spreadsheet

Load mainframe db2 from Excel spreadsheet

(OP)
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

RE: Load mainframe db2 from Excel spreadsheet




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

Are you running VBA in Excel?  

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Load mainframe db2 from Excel spreadsheet

(OP)
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

RE: Load mainframe db2 from Excel spreadsheet

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.

 

RE: Load mainframe db2 from Excel spreadsheet



Quote:

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,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Load mainframe db2 from Excel spreadsheet

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 smile

RE: Load mainframe db2 from Excel spreadsheet

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
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close