hi,
Can anyone clearly explain the comp in Cobol language?
Regards,
suhaniya.
doubt - COMP in COBOL
Moderators: dbzTHEdinosauer, Moderator Group
COBOL COMP
Hi suhaniya,
Data item defined with COMP is represented in pure binary.
As a programmer, we need to know following.
9(1) COMP to 9(4) COMP => Occupies 2 bytes of storage
9(5) COMP to 9(9) COMP => Occupies 4 bytes of storage
9(10) COMP to 9(18 ) COMP => Occupies 8 bytes of storage.
COMP data item should not contain any character other than 9,S
Let me know, if you need any other details.
Data item defined with COMP is represented in pure binary.
As a programmer, we need to know following.
9(1) COMP to 9(4) COMP => Occupies 2 bytes of storage
9(5) COMP to 9(9) COMP => Occupies 4 bytes of storage
9(10) COMP to 9(18 ) COMP => Occupies 8 bytes of storage.
COMP data item should not contain any character other than 9,S
Let me know, if you need any other details.
Natarajan
Chennai
Chennai
COMP VS COMP-3
More info on COMP in COBOL.
comparison between COMP and COMP-3
- Binary format might not be suited for decimal alignment as packed
decimal format.
- Binary format is not converted to and from DISPLAY format as easily as
packed decimal format.
comparison between COMP and COMP-3
- Binary format might not be suited for decimal alignment as packed
decimal format.
- Binary format is not converted to and from DISPLAY format as easily as
packed decimal format.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Hi,
Comp (with no suffix) leaves the choice of the data type to the compiler writer. The intent of this data type is to make it the most efficient format on any given machine, which is usually some binary format. Because of this, comp varies greatly between platforms, more than most other types.
Comp (with no suffix) leaves the choice of the data type to the compiler writer. The intent of this data type is to make it the most efficient format on any given machine, which is usually some binary format. Because of this, comp varies greatly between platforms, more than most other types.
Regards,
Anuj
Anuj
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page