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

help- convert 3 digits into 2 bytes


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

New User


Joined: 03 Mar 2006
Posts: 2

PostPosted: Fri Mar 03, 2006 4:54 am
Reply with quote

Hi,

data1 pic 9(4).
data2 pic x(2)
Need help, i need to convert all numeric data from data1 > 99 into data2.

Data2 can be alpha numeric also.

plz help me.

Thanks,
Vas
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Fri Mar 03, 2006 11:36 am
Reply with quote

Hi,

The above is not possible.
Could you please explain the requirement more clearly?

Thanks,
KS
Back to top
View user's profile Send private message
sp_vas

New User


Joined: 03 Mar 2006
Posts: 2

PostPosted: Fri Mar 03, 2006 7:04 pm
Reply with quote

Hi KS,

directly its may not be possible,... but requirement is that i have a data1 field which is 4 bytes aand was getting mapped to 2 bytes..

wherein we were always getting 0-99 nos but suddenly we r expected to get 0-999 numbers so when it gets mapped to 2 bytes we will be loosing all values more than 99...

so i need to develop an algorithm .. ex something like convering into dexa decimal and then again decoding..

exp 100 can be mapped as AA or XX or HF etc and decode again.

Thanks,
Vas
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Fri Mar 03, 2006 7:19 pm
Reply with quote

hy buddy,

define your pic 9(04) usage display to pic s9(04) usage binary,
then the field is only 2 bytes long and fits into pic x(02).
how you identify, if this value is more than 100, for this
you must do your own logic...

martin9
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 Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top