IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we use % operator in COBOL ,like in C if yes Then how


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ritesh pandey

New User


Joined: 09 Feb 2007
Posts: 11
Location: Pune

PostPosted: Wed Dec 03, 2008 3:28 pm
Reply with quote

Can we use '%' operator in COBOL ,like in C if yes Then how .
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Dec 03, 2008 3:36 pm
Reply with quote

No.
Back to top
View user's profile Send private message
atosvv

New User


Joined: 04 Dec 2008
Posts: 11
Location: Mumbai

PostPosted: Fri Dec 05, 2008 12:13 pm
Reply with quote

Hi Ritesh,

I think you are looking for the MOD operator (to obtain the remainder while performing division) equivalent in COBOL.

Please refer the DIVIDE ...... REMAINDER in COBOL.
DIVIDE A BY B GIVING C REMAINDER D.

Keep Learning.

icon_smile.gif
-VV
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Dec 05, 2008 3:11 pm
Reply with quote

I thought like %d, %f in displays..
Never though it could be for mod operator.. Let's see what OP says on this.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Dec 05, 2008 5:52 pm
Reply with quote

Quote:
I think you are looking for the MOD operator (to obtain the remainder while performing division) equivalent in COBOL.

Please refer the DIVIDE ...... REMAINDER in COBOL.
DIVIDE A BY B GIVING C REMAINDER D.
and
Quote:
I thought like %d, %f in displays..
Never though it could be for mod operator..

Another example of why it is so vital to be very clear and precise (and use the correct terminology) in the questions posed on this forum -- so frequently there are multiple interpretations to what is asked and additional clarification is required to answer the actual question, not the understood question.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Dec 05, 2008 6:17 pm
Reply with quote

By the way even I thought about mod operator, I was on the way back to Mumbai so could not reply.

-Ad
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top