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
 

 

help- convert 3 digits into 2 bytes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: help- convert 3 digits into 2 bytes
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    Post subject:
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    Post subject:
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: 288
Location: Basel, Switzerland

PostPosted: Fri Mar 03, 2006 7:19 pm    Post subject:
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    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
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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