I want to convert a 5 byte Alphanumeric field into a 4 byte alphanumeric field.ie X(05) to X(04).
If the input is numeric we move a 5 byte into a 4 byte without truncation, using packed format like S9(8) comp-3.But here my problem is that the input is Alphanumeric.In case the source is AN, this move will give u a S0C7 abend.
If we prepare a mapping table,the number of combinations is very large.
If the input is numeric ,it will work , we can use some comp fileds for compression.My problem is it culd be any valid numeric or alphabet at any position.say can example ABCDE or ABC123 likewise.Even if it is ABCDE i need to convert it uniquely into a 4 byte field.
Input is 5 byte Alphanumeric .I need to convert it into a 4 byte Alphanumeric to store it in my master file.
No truncation should happen.We should be able to convert it back to 5 byte alphanumeric also.
I had once successfully tried converting a 5 byte alphanumeric to 4 byte numeric.But in that case the last 3 byte of the AN input was always numeric.So I used a Base10-> base36 conversion algorithm to do this conversion(ie last 3 byte numeric to 2 byte) so total 5 byte to 4 byte.
But here the problem is that It could be any valid numeric or alphabet at any position from 1 to 5.
I think its an interesting challenge .Can any one take it Up