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
 

 

Removing junk characers from records in a DB2 table

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

New User


Joined: 27 Feb 2008
Posts: 75
Location: india

PostPosted: Mon Sep 16, 2013 2:57 pm    Post subject: Removing junk characers from records in a DB2 table
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    Post subject:
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    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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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