output record 1 : 039 041 <= grouped input rec 1,input rec 2,input rec 3 since they a continuous range.
output record 2 : 069 069 <= not a continous range,so written as same starting and ending range.
I tried to acheive this by Eztrieve, I read the input as NUMERIC and found the DIFF of the two records and written the output when the numeric difference is > 1. Its not working properly for few ranges like the one shown below.
input
15J
150
expected output
15J 15J
150 150
actual ouput
15J 150 <= which finding the differnce of X(F1F5D1) and X(F1F5F0), it came with a diff of 1 so considered these are a consecutive numbers.but they are not so, after 15J , 15K thru Z should follow.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, if you're happy...
Code:
038 F0F3F8
039 F0F3F9
040 F0F4F0
If you are saying that, in the Easytrieve, you defined the fields as binary and then carried on with the calculations as is, I can see 038 to 039 "working", but how does it lnow that 040 is next?
Even ignoring that you are doing the subtraction the "wrong way round" and getting the answer of one or greater than one because you are using an unsigned fielld as your result, when you do the 039 - 040, in binary, you are not going to get an answer of one.
Also, with the letters, how does I get to be included with J, and R with S?
I'd like to see the code you have.
If you've got your solution with Easytrieve, this topic should go to the CA forum. although if we leave it here tonight, we might see the DFSORT solution anyway...
Hi Bill,
you are right, i got some junk characters when I tried to convert Binary to Alpha in EZ. As you pointed out the sequence for 39,39,40 was not considered as consecutive number.
Code:
038 F0F3F8
039 F0F3F9
040 F0F4F0
I'll leave the EZ way,and try out the DFSORT from Kolusu
DFSORT is bang on target. I missed to tell you that the Alpha char can appear in any of those 3 positions. Maybe I should have posted a clear cut input seq.
input:
Code:
039
040
041
069
1AA
1A0
1C5
10K
12K
12L
AAA
B21
Please tell me who I should modify the sort to parse out the Alpha to number on all 3 postions.