Aug 21, 2002 #1 AFPBoy Programmer Apr 26, 2002 5 US How can you calculate a remainder in Cobol ex. 1197/103 = 11 remainder 67
Aug 21, 2002 #2 MKuiper Programmer Jan 29, 2002 364 NL The easy way: DIVIDE <1> BY <2> GIVING <3> REMAINDER <4>. <1> and <2> are numeric fields or literals <3> and <4> are numeric fields The other easy way: COMPUTE <4> = <1> - (( <1> / <2> ) * <2> ) Marcel Upvote 0 Downvote
The easy way: DIVIDE <1> BY <2> GIVING <3> REMAINDER <4>. <1> and <2> are numeric fields or literals <3> and <4> are numeric fields The other easy way: COMPUTE <4> = <1> - (( <1> / <2> ) * <2> ) Marcel
Aug 21, 2002 #3 MKuiper Programmer Jan 29, 2002 364 NL After I send my post, I found the real reason for your question: The remainder of 1197 divided by 103 is 64 and not 67 :-( Good you asked this forum. Marcel Upvote 0 Downvote
After I send my post, I found the real reason for your question: The remainder of 1197 divided by 103 is 64 and not 67 :-( Good you asked this forum. Marcel
Aug 21, 2002 #4 MarcLodge Programmer Feb 26, 2002 1,886 GB Also, depending upon your compiler you can COMPUTE WS-REMAINDER = FUNCTION MOD ( 1197, 103) but Marcel is right, the remainder is 64! Marc Upvote 0 Downvote
Also, depending upon your compiler you can COMPUTE WS-REMAINDER = FUNCTION MOD ( 1197, 103) but Marcel is right, the remainder is 64! Marc