Page 1 of 1

How to transfer db2 data to Excel

PostPosted: Mon Aug 20, 2012 2:01 am
by Viswanathchandru
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.

Regards,
Viswa

Re: How to transfer db2 data to Excel

PostPosted: Mon Aug 20, 2012 3:28 am
by dick scherrer
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.

Re: How to transfer db2 data to Excel

PostPosted: Mon Aug 20, 2012 4:06 pm
by Quasar
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 -
01  SMF-RECORD.
    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.

Thanks,
Quasar