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
 

 

Format of 1234 in COMP, COMP-1, COMP-2, COMP-3

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Mon Feb 16, 2004 7:41 pm    Post subject: Format of 1234 in COMP, COMP-1, COMP-2, COMP-3
Reply with quote

Can anybody explain the internal format of 1234 in COMP, COMP-1, COMP-2, COMP-3?

And the size of 1234 in all computational classes?
Back to top
View user's profile Send private message

pradeep

New User


Joined: 31 Jan 2004
Posts: 10
Location: Surandai,India

PostPosted: Thu Feb 26, 2004 3:50 pm    Post subject: COMP, COMP-1, COMP-2,COMP-3 DIFERENCES
Reply with quote

Hello sir,

In general 1 byte = 8 bits.
4 bytes = 1 fullword
2 bytes = 1/2 word

DISPLAY Default. Number of bytes required equals to the size of the data item.
COMP Binary representation of data item.
PIC clause can contain S and 9 only.
S9(01) – S9(04) Half word.
S9(05) – S9(09) Full word.
S9(10) - S9(18) Double word.
Most significant bit is ON if the number is negative.

COMP-1 Single word floating point item. PIC Clause should not be specified.
COMP-2 Double word floating-point item. PIC Clause should not be specified.
COMP-3 Packed Decimal representation. Two digits are stored in each byte.
Last nibble is for sign. (F for unsigned positive, C for signed positive
and D for signed negative)
Formula for Bytes: Integer ((n/2) + 1)) => n is number of 9s.
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 Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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