Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
about comp-4,comp-5,comp-6

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
shasikanthsingh

New User


Joined: 29 Oct 2003
Posts: 1

PostPosted: Wed Oct 29, 2003 7:51 pm    Post subject: about comp-4,comp-5,comp-6
Reply with quote

hi,

if any one know are heard about comp-4,comp-5,comp-6 please post the reply this was asked in my interview.

and if any one heard about 76 and 78 level number give the information


with regards,

harini navathi
Back to top
View user's profile Send private message
References
PostPosted: Wed Oct 29, 2003 7:51 pm    Post subject: Re: about comp-4,comp-5,comp-6 Reply with quote

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 257
Location: USA

PostPosted: Wed Oct 29, 2003 10:42 pm    Post subject:
Reply with quote

Hello shasikanthsingh,

check out the following link for more information:

http://www.cis.scu.edu.tw/oproom/doc/acucobol/docs/comprun/gt400419.htm


The format of a COMP-4 item is two's-complement binary. COMP-4 values are stored in a machine-independent format. This format places the highest-order part of the value in the leftmost position and follows down to the low-order part in the rightmost position. The number of bytes a data item occupies depends on the number of "9"s in its PICTURE and on the presence of various compile-time options. This is summarized in the following table:


Code:
# of "9"s    Default    -D1    -Dm
  1-2            2           1       1
  3-4            2           2       2
  5-6            4           4       3
  7-9            4           4       4
 10-11           8           8       5
 12-14           8           8       6
 15-16           8           8       7
 17-18           8           8       8

The format of a COMP-5 data item is identical to a COMP-4 data item, except that the data is stored in a machine-dependent format. It is stored in an order that is natural to the host machine. For example, a PIC S9(4) COMP-5 data item is equivalent to a 16-bit binary word on the host machine, and a PIC S9(9) COMP-5 item is equivalent to a 32-bit word. Note that data stored in a COMP-5 field may not be transportable to other machines because different machines have different natural byte-orderings. On many machines (68000, most RISC), COMP-5 is identical to COMP-4. On others (80x86, VAX), it is the same with the bytes in the reverse order.

COMP-5 is primarily used to communicate with external programs that expect native data storage. A VALUE clause for a COMP-5 data item is stored in a machine-independent format and is adjusted when it is loaded into the data item. This ensures that the value is the same from machine to machine.

Level 01 and level 77 data items that are COMP-5 are automatically synchronized to an appropriate machine boundary, regardless of any compile-time settings. This allows you to pass these items safely to C subroutines without having to concern yourself with alignment.

The format of a COMP-6 item is identical to a COMP-3 item except that it is unsigned and no space is allocated for the sign. Thus there are two decimal digits per byte, and the actual size of the item is determined by dividing its PICTURE size by two and rounding up.


About Level 76 & 78, will get back to you on this.

Hope this helps

Regards

Mayuresh Tendulkar
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1