IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Removing junk characers from records in a DB2 table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 108
Location: india

PostPosted: Mon Sep 16, 2013 2:57 pm
Reply with quote

I have few junk records in a DB2 table.
one field, Emp No has 14 characters size.
This field has few records(almost 100 records) in that table which are junk records. The junk records are like: MSKU1851295ááá, MRKU7998390 á.

So I want to remove these junk characters from these records.
I can able to fetch these records thru a SQL query. But my intention is to remove these junk characters from these records. After changes, these above records should be: MSKU1851295, MRKU7998390.
How to do this in a better way?
Thanks in advance
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Sep 16, 2013 5:33 pm
Reply with quote

If the junk character is same.

you can use replace or translate function.

Code:
 select 'MSKU1851295ááá' , replace('MSKU1851295ááá','á', '') , translate('MSKU1851295ááá','', 'á')
 from sysibm.sysdummy1;
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Inserting records into the empty segm... IMS DB/DC 0
No new posts Need to read duplicate rows from tabl... DB2 3
No new posts JCL to extract repeating records DFSORT/ICETOOL 6
No new posts Group selective VB records - Trailer ... DFSORT/ICETOOL 16
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... SYNCSORT 1

Back to Top