Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us