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: 1226
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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