Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to define an binary number in Cobol?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to define an binary number in Cobol?
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: 1232
Location: Israel

PostPosted: Tue Nov 14, 2006 9:02 pm    Post subject:
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    Post subject: Re: How to define an binary number in Cobol?
Reply with quote

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

Refer to manual link for details (Page 225)

http://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    Post subject:
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: 128
Location: kerala,india

PostPosted: Tue Nov 21, 2006 2:38 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us