Removing comma on a value - Need your help



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Removing comma on a value - Need your help

Postby rajaranganathan » Thu Oct 31, 2013 8:48 pm

Hi All,

Thanks for all your support and help on this.

I have a value which is comma separated and i required to remove the comma interms of adding the values using sort.

Example:
13,398
48,483
645


Expected result:
0013398
0048483
0000645


Can any one , please help me with this ??
rajaranganathan
 
Posts: 27
Joined: Thu Oct 10, 2013 6:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing comma on a value - Need your help

 

Re: Removing comma on a value - Need your help

Postby BillyBoyo » Thu Oct 31, 2013 9:28 pm

Define your entire field as a UFF format (Unsigned Free Format). This will process the field to remove all non-numeric characters, you can then have it output as a ZD of length 8 to get your result. If you needed decimal places or something else, like still have leading spaces, you would use an EDIT to do the formatting, but your case is really simple.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Removing comma on a value - Need your help

Postby rajaranganathan » Thu Oct 31, 2013 9:31 pm

Bill,
Thank you very much for your help. If you don't mind can you please provide me an example to define the field as UFF format ? I tried google but it didn't work out.
rajaranganathan
 
Posts: 27
Joined: Thu Oct 10, 2013 6:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing comma on a value - Need your help

Postby NicC » Thu Oct 31, 2013 9:48 pm

why don't you try the manual?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Removing comma on a value - Need your help

Postby rajaranganathan » Fri Nov 01, 2013 4:16 pm

Hi All,

Thank you very much for your help. It worked.

INREC BUILD=(01:4,7,UFF,M11,LENGTH=7

Raja.R
rajaranganathan
 
Posts: 27
Joined: Thu Oct 10, 2013 6:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Removing comma on a value - Need your help

Postby BillyBoyo » Fri Nov 01, 2013 4:30 pm

OK. Thanks for letting us know. You only need the column number on BUILD if you want to leave something set to the fill value, so you don't need the 01:.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post