View previous topic :: View next topic |
Author |
Message |
brijesh_mca1 Beginner

Joined: 21 Nov 2005 Posts: 19 Topics: 10 Location: India
|
Posted: Wed Sep 12, 2007 7:36 am Post subject: Need to find the REMAINDER of 28 digit numeric field |
|
|
Hi,
In one of my program , I need to find the reminder of 28 digit numeric field when that is divided by 97. and the last 2 digits will always be 00.
Note: Cobol numeric data can be maximum of 18 bytes.
Please help, How can I solve this problem.
Thanks in Advance _________________ Brijesh(India Is Great) |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12382 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Wed Sep 12, 2007 10:20 am Post subject: Re: Need to find the REMAINDER of 28 digit numeric field |
|
|
brijesh_mca1 wrote: | In one of my program , I need to find the reminder of 28 digit numeric field when that is divided by 97. and the last 2 digits will always be 00.
Note: Cobol numeric data can be maximum of 18 bytes. |
Take the 28 digit number and split it into two 14 byte strings.
MOD 97 into the first (higher half) - the remainder is the mod value or just divide, multiply back the integer portion of the answer and subract that from the original.
Take the MOD (remainder) and plug it to the high end of the lower half and MOD 97 again...... |
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Fri Sep 28, 2007 8:37 am Post subject: |
|
|
brijesh_mca1 wrote: | Hi,
This approch wored for me. Sorry for replying late, as not cheking my inbox on regular basis.
Take the 28 digit number and split it into two 14 byte strings.
MOD 97 into the first (higher half) - the remainder is the mod value or just divide, multiply back the integer portion of the answer and subract that from the original.
Take the MOD (remainder) and plug it to the high end of the lower half and MOD 97 again......
Brijesh |
|
|
Back to top |
|
 |
|
|