IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Conversion of 5 byte Alphanumeric into 4 byte Alphanumeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
coolsyam

New User


Joined: 29 Jun 2006
Posts: 3

PostPosted: Thu Jun 29, 2006 12:51 pm
Reply with quote

Hi

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.

Any suggestions icon_question.gif
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 29, 2006 4:03 pm
Reply with quote

I have not tried this but try this.

Redefine the moved into AN field as numeric one and check if sending field IS-NUMERIC, if numeric move it to the numeric redefined field else move it to the AN field.

Let me know if you succeed.
Back to top
View user's profile Send private message
coolsyam

New User


Joined: 29 Jun 2006
Posts: 3

PostPosted: Thu Jun 29, 2006 4:41 pm
Reply with quote

Hi

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.

Any suggestion on base conversion or so ??
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Thu Jun 29, 2006 6:59 pm
Reply with quote

Is that it?
Is there anything you are not telling us?
Back to top
View user's profile Send private message
coolsyam

New User


Joined: 29 Jun 2006
Posts: 3

PostPosted: Thu Jun 29, 2006 7:12 pm
Reply with quote

I will clarify my requirement in detail

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 icon_eek.gif .Can any one take it Up icon_wink.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Dataset size increase on adding 1 byt... DFSORT/ICETOOL 8
Search our Forums:

Back to Top