How to transfer db2 data to Excel

IBM's Command List programming language & Restructured Extended Executor

How to transfer db2 data to Excel

Postby Viswanathchandru » Mon Aug 20, 2012 2:01 am

Dear Quasar/All,

First of all, Sorry for not opening a seperate topic as i thought shooting my question at this page would give me some solution. I had a tedious work in my shop(Kind of report generation from SMF records). Now i have tried to make it little easy, but still the final step would be like copying the contents from the flat file to a Excel sheet which would be very helpful for me. I read here like unloading the DB tables and getting the output to excel(upto my understanding). Quite interesting. Can anyone throw some light on how to transfer a PS dataset into an Excel(seems the question is very raw!) Is that done through Rexx :o Apologies if i or my thoughts are wrong.

Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: How to transfer db2 data to Excel


Re: How to transfer db2 data to Excel

Postby dick scherrer » Mon Aug 20, 2012 3:28 am

Your topic has been split as it has nothing to do with the topiic you appended to :(

To do what you want, create a tab-delimited (x'05') file and ftp it to the machine where excel is to use it.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to transfer db2 data to Excel

Postby Quasar » Mon Aug 20, 2012 4:06 pm

Hi Vishwanathan,

I am not aware, how you have extracted and formatted the SMF Data(probably using your custom program). But, once you've got the SMF Data on a flat file, I would suggest the following approaches.

1. You can insert a separator character X'05' (Hexadecimal 05), between the columns and download the data as a .xls File. You'd have the COBOL 01-Level area defined as -
    05 SMF-DATA-FIELD-1 PIC X(16).
    05 FILLER           PIC X VALUE X'05'.
    05 SMF-DATA-FIELD-2 PIC X(10).
    05 ...              PIC X VALUE X'05'.

2. You can insert commas(,) and download the file as a .csv(Comma Separated Values) file.

3. You may even use some HTML Formatting to do apply some background color, bold, italics etc.

I have tried out approach (3) at an earlier shop, to produce reports, which are presentable.

Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times

Return to CLIST & REXX


  • Related topics
    Last post