MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Export QMF report to EXCEL spreadsheet

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Wed Feb 15, 2006 1:06 pm    Post subject: Export QMF report to EXCEL spreadsheet Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Feb 15, 2006 1:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Wed Feb 15, 2006 3:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Feb 15, 2006 3:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Wed Feb 15, 2006 3:43 pm    Post subject: Reply with quote

Kolusu,

It works fine now. Thanks.
Back to top
View user's profile Send private message
Jamylady
Beginner


Joined: 04 Nov 2004
Posts: 68
Topics: 22

PostPosted: Wed Apr 12, 2006 8:56 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 12, 2006 9:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Jamylady
Beginner


Joined: 04 Nov 2004
Posts: 68
Topics: 22

PostPosted: Wed Apr 12, 2006 9:40 am    Post subject: Reply with quote

Thanks many
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group