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
 
How much bytes do S9(7)V99 COMP-3 occupy?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
Tom Goodhart

New User


Joined: 16 Jul 2008
Posts: 2
Location: Tennessee

PostPosted: Fri Jul 18, 2008 1:18 am    Post subject:
Reply with quote

Not coding the S for sign in the picture will cause values to be stored with "F" as the sign. An positive integer value which mathematically equal to +1.

If you code an even number of digits, the compiler will always make it 1 byte larger internally.
Thus,
S9(6) COMP-3 will take 4 bytes of storage
S9(7) COMP-3 will take 4 bytes of storage This is the preferred way as it is clear to anyone what was intended.
Back to top
View user's profile Send private message
References
PostPosted: Fri Jul 18, 2008 1:18 am    Post subject: Re: Reply with quote

Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 22
Location: bangalore

PostPosted: Fri Jul 18, 2008 8:22 pm    Post subject:
Reply with quote

Quote:

If the number is +1234.It is stored as,
(In Hex) 01 23 4C


Is this
(In Hex) 4D2 ? . Please clear me .
Back to top
View user's profile Send private message
Robert Sample

Senior Member


Joined: 06 Jun 2008
Posts: 534
Location: Atlanta, GA

PostPosted: Fri Jul 18, 2008 8:30 pm    Post subject:
Reply with quote

No:

Hex 0004D2 is the BINARY (or COBOL COMP) value of +1234.
Hex 01234C is the PACKED-DECIMAL (or COBOL COMP-3) value of +1234.
Hex F1F2F3F4 is the unsigned COBOL DISPLAY value of 1234.
Hex F1F2F3C4 is the signed COBOL DISPLAY value of +1234.
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 22
Location: bangalore

PostPosted: Fri Jul 18, 2008 8:45 pm    Post subject:
Reply with quote

Robert ,

Understood .. Thax
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 HoursGoto page Previous  1, 2
Page 2 of 2