Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Conversion of 5 byte Alphanumeric into 4 byte Alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Conversion of 5 byte Alphanumeric into 4 byte Alphanumeric
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    Post subject:
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    Post subject:
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    Post subject: Re: Conversion of 5 byte Alphanumeric into 4 byte Alphanumer
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us