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

How to define an binary number in Cobol?


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

New User


Joined: 24 Oct 2006
Posts: 10

PostPosted: Tue Nov 14, 2006 8:57 pm
Reply with quote

Hi,
How to define an binary number in Cobol?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Nov 14, 2006 9:02 pm
Reply with quote

use COMP:
PIC S9(4) COMP for halfword
PIC S9(8) COMP for fullword
Back to top
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Tue Nov 14, 2006 9:16 pm
Reply with quote

Define field as COMP, COMP-4, or COMP-5.

Refer to manual link for details (Page 225)

publibfp.boulder.ibm.com/epubs/pdf/igy3lr31.pdf
Back to top
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Mon Nov 20, 2006 6:47 pm
Reply with quote

COMP is the binary represention of data item in COBOL

Ex:-

ws-cop pic S9(4) COMP
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Tue Nov 21, 2006 2:38 pm
Reply with quote

Defining a binary number means what?
COMP only converts the number to binary at the time of storage
so it increases the speed of arithmatic operations is that what you asked
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 Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top