View previous topic :: View next topic |
Author |
Message |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Wed Feb 15, 2006 1:06 pm Post subject: Export QMF report to EXCEL spreadsheet |
|
|
To export QMF report to EXECL spreadsheet:
1. Run the query under qmf
2. Export data to a dataset (column are delimited by '0000'x)
3. Convert '0000'x to ',' or ';' since EXCEL doesn't allow me to specify the delimiter in hex format (providing data doesn't contains ',' or ';')
4. Download data to PC
5. Open downloaded file in EXECL with delimiter ',' or ';'
Is it possible to to skip the step of converting the deliminer '0000'x to ',' or ';' first? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Feb 15, 2006 1:11 pm Post subject: |
|
|
danm,
1. Simply unload the data using dsntiaul by specifying the columns.
ex:
Code: |
SELECT COL1
,CHAR(';')
,COL2
,CHAR(';')
,COL3
..
FROM TABLE
;
|
2. Download the unload dataset to pc
3. Open it in excel with delimiter ';'
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Wed Feb 15, 2006 3:19 pm Post subject: |
|
|
Kosulu,
But there is one problem. If any columns in the table contains a ';', then the delimiter ';' will not work in EXCEL. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Feb 15, 2006 3:29 pm Post subject: |
|
|
Quote: |
But there is one problem. If any columns in the table contains a ';', then the delimiter ';' will not work in EXCEL.
|
In that case use TAB (X'05') as the delimiter.
ie.
Code: |
SELECT COL1
,CHAR(X'05')
,COL2
,CHAR(X'05')
,COL3
..
FROM TABLE
;
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Wed Feb 15, 2006 3:43 pm Post subject: |
|
|
Kolusu,
It works fine now. Thanks. |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Wed Apr 12, 2006 8:56 am Post subject: |
|
|
I have been thinking of asking this question.
Why am I getting the output as follows
2004..|089|001 when I use the following SQL to unload?
SELECT STARTX_YR,'|',DEPT_SYS_CD,CHAR('|')
FROM BXNA45.TABLE01?
If I dont use the CHAR, i am getting the '..'. Where is it coming from?
Thanks
JA |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Apr 12, 2006 9:39 am Post subject: |
|
|
Jamylady,
When you code a character string within quotes DB2 assumes that it is a varchar string and adds the 2 extra bytes which contain the length of the string. By adding the CHAR function it is treated as the character string and you will not see the additional 2 bytes.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Wed Apr 12, 2006 9:40 am Post subject: |
|
|
Thanks many |
|
Back to top |
|
|
|
|