MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need to find the REMAINDER of 28 digit numeric field

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
brijesh_mca1
Beginner


Joined: 21 Nov 2005
Posts: 19
Topics: 10
Location: India

PostPosted: Wed Sep 12, 2007 7:36 am    Post subject: Need to find the REMAINDER of 28 digit numeric field Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Wed Sep 12, 2007 8:02 am    Post subject: Reply with quote

brijesh_mca1,

http://www.mvsforums.com/helpboards/viewtopic.php?p=8586#8586

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Sep 12, 2007 10:20 am    Post subject: Re: Need to find the REMAINDER of 28 digit numeric field Reply with quote

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
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Fri Sep 28, 2007 8:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group