Appending zeros using UFF



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

Appending zeros using UFF

Postby itstg » Tue Jun 03, 2014 2:51 pm

Hello gurus,

I have a file which is VB and is of the following format

1|201403|18092000010|1|Y|3132.68|16|0|1|1|1|0|1|1|1|1|1|1|0           
1|201403|94954110083|0|N|0.00|0|0|1|0|1|0|0|0|0|0|0|0|0               
1|201403|8358210009|0|N|0.00|0|0|1|0|1|1|1|0|1|0|0|0|0               
1|201403|211312005|1|N|340.00|18|0|0|0|0|0|0|0|0|1|0|0|0             
1|201403|8986802|1|N|1733.33|46|0|0|0|0|0|0|1|0|1|0|0|0           


The desired output would be
1|201403|18092000010|1|Y|3132.68|16|0|1|1|1|0|1|1|1|1|1|1|0           
1|201403|94954110083|0|N|0.00|0|0|1|0|1|0|0|0|0|0|0|0|0               
1|201403|08358210009|0|N|0.00|0|0|1|0|1|1|1|0|1|0|0|0|0               
1|201403|00211312005|1|N|340.00|18|0|0|0|0|0|0|0|0|1|0|0|0             
1|201403|00008986802|1|N|1733.33|46|0|0|0|0|0|0|1|0|1|0|0|0           


What is essentially required is to append trailing zeros to the colum starting at position 10 (till the point of the next double pipes).Can this be achived using UFF in SORT. Any help on this would be great.

Thanks in advance,
IT STG
itstg
 
Posts: 1
Joined: Tue Jun 03, 2014 2:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Appending zeros using UFF

 

Re: Appending zeros using UFF

Postby BillyBoyo » Tue Jun 03, 2014 3:13 pm

Those are leading zeros, not trailing zeros.

You will need to use PARSE, to extract that number, and to extract the remaining part of the record. Field type FS when putting the data back together, or an EDIT. You will need to use VLTRIM on OUTFIL to drop the blanks created by the second PARSEd field.
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