Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Non displayable characters while unloading data in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Tue Jan 22, 2008 6:12 pm    Post subject: Non displayable characters while unloading data in DB2
Reply with quote

Hi,

When I unload the data and browse(view) the dataset in BROWSE mode I see non displayable characters. The columns are defined as VARCHAR however I see nothing in the QMF. This is happening only when I unload the data into dataset.

Do anyone have any idea why is this so..?. In my case

Code:
SELECT S.KNID,                                             
       S.NVFO, S.NVEF,                                     
       S.ADLI01, S.ADLI02,                                 
       S.ADLI03, S.ADLI04,                                 
       S.ADLI05, S.ADLI06,                                 
       S.ADLI07, K.PDNR                                     
 FROM  EB.TKUNDESTAM S,EB.TKONTOSTAM K                     
 WHERE S.KNID = K.KNID                                     
 AND   S.RSLD = 'DK'                                       
 AND   K.PDNR IN                                           
(SELECT PRODUKT_NR FROM EB.PRODUKT_RELATION_H               
WHERE SCORETABEL_ID IN ('L','M','T')) WITH UR               


The columns S.NVFO thru S.ADLI07 are defined as VARCHAR in DB2. In few columns I see this characters after the data. If there is no data in the columns then it is full of junk characters.

Please help me in getting spaces if there is no data and only data if it contains some data. I will be sorting this data set later to eliminate duplicates and order the data.

Please see the attachment. Thanks..!
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jan 22, 2008 6:19 pm    Post subject:
Reply with quote

Varchar columns in the unload have a two byte binary LENGTH field before the data.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Jan 22, 2008 7:05 pm    Post subject:
Reply with quote

Order the data on extract with ORDER BY and write your WHERE clause so you don't have to post process the data.
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Jan 23, 2008 2:37 pm    Post subject:
Reply with quote

Well, Join is not on unique columns and cant use DISTINCT to remove duplicates as there are 12 million rows in each table.

Query is taking long long time.

This not for length, even data looks like ............................. though the HEX value of the two byte length says it is zero. I dont understand how to remove this. This happens everytime I unload.

I'm afraid to put ORDER by again becuase of performance. Explain results says one of the table is going for tablespace scan with Nested loop scan with the other one. The columns included in this join are part of index keys and not complete.

Requirement is such a way....Adding index doesn't make sense to me as this is just one time process. One time data extract..!

Please let me know your comments.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Jan 23, 2008 7:23 pm    Post subject:
Reply with quote

If its a one time extract, performance should not be any concern. Put the ORDER BY on there.

If the hex length is 0, there is no data in that field for that row.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us