Posted: Sat Nov 12, 2005 11:27 am Post subject: Convert left justified Digits to Actual Numeric
Hi
I have a requirment to get the numeric number which is left justfied with digits. This left justified digits are always digits.
I have Syncsort in my Shop.
I posted this question to Syncsort before knowing this forum.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Sat Nov 12, 2005 11:38 am Post subject:
For the record, there's a better way with DFSORT, but NOT with Syncsort. With DFSORT, you can use the UFF format to do this kind of thing quite easily as follows:
Note that you can handle up to 31 digits this way. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
CASE IDX
WHEN 1
MOVE '000000000' TO O-REC(1) W-PADZERO-LEN
WHEN 2
MOVE '00000000' TO O-REC(1) W-PADZERO-LEN
WHEN 3
MOVE '0000000' TO O-REC(1) W-PADZERO-LEN
WHEN 4
MOVE '000000' TO O-REC(1) W-PADZERO-LEN
WHEN 5
MOVE '00000' TO O-REC(1) W-PADZERO-LEN
WHEN 6
MOVE '0000' TO O-REC(1) W-PADZERO-LEN
WHEN 7
MOVE '000' TO O-REC(1) W-PADZERO-LEN
WHEN 8
MOVE '00' TO O-REC(1) W-PADZERO-LEN
WHEN 9
MOVE '0' TO O-REC(1) W-PADZERO-LEN
END-CASE
MOVE I-REC(1) IDX TO O-REC(ODX) W-STR-LEN
END-IF
IDX = IDX + 1
END-DO
PUT OUTPUT
Thanks Kolusu for considering my question.
I was looking for SORT Solution . I can't apply Frank's Method due TO limitation of Syncsort. I apreciate Franks help.
I did this in easytrieve in the following way.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Sat Nov 12, 2005 4:47 pm Post subject:
Quote:
Thanks Kolusu for considering my question.
I was looking for SORT Solution .
DGM,
Syncsort does not support UFF/SFF formats. so the only way it can be done using syncsort is shown by you. However there are a alternative ways of doing it ,however they CANNOT beat DFSORT's solution. check this link
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum