View previous topic :: View next topic
|
Author |
Message |
vero123
New User
Joined: 10 Sep 2005 Posts: 4
|
|
|
|
Hi,
I have to convert 16-digit number which is in the form of X(16) data into packed X(9) data. Could any body let me know how to go about it.
Thanks in advance, |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
I could't get into your question. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I'm guessing you want to somehow store the value of a 16 digit number in 9 bytes of data.
Since is's 9 bytes and not 8, that eliminates conversion to binary (COMP).
That leaves conversion to packed decimal (COMP-3).
Code: |
01 16-byte-x-fld pic x(016).
01 16-byte-9-fld redefines
16-byte-x-fld pic S9(016).
01 9-byte-pd-fld pic S9(016) comp-3.
move 16-byte-9-fld to 9-byte-pd-fld |
|
|
Back to top |
|
|
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 104 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi Jack,
I think,you missed to specify the usage as COMP-3 for 9-byte-pd-fld in your code.
Regards,
Sridevi. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Good catch Sridevi. I made the correction.
Thanx and |
|
Back to top |
|
|
|