How to check the end of a COMP-3 variable

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
neeraja
Member
Posts: 8
Joined: Sun Nov 18, 2007 12:40 pm
Location: India

How to check the end of a COMP-3 variable

Post by neeraja » Thu Jan 10, 2008 9:32 pm

Hi,

Pls let me know

How to check the end of a COMP-3 variable and how the COMP-3 variable look alike
Example
x=1234
its a COMP-3 variable how it looks

vanithaaraju
Member
Posts: 12
Joined: Tue Dec 11, 2007 4:51 pm

Post by vanithaaraju » Fri Jan 11, 2008 4:05 pm

Hi,

I am not getting what you mean by checking the end of comp-3 variable.

comp-3 variables are represented in packed decimal format.

for ex:

01 x pic 9(4) value 1234.

internal representation: 0001 0010 0011 0100
value : 1 2 3 4

each digit takes half a byte. so 9(4) takes only 2 bytes.
vanithaa

Post Reply

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



Other References
Mainframe Tools and others