MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Computational Items

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Dec 01, 2002 10:51 pm    Post subject: Computational Items Reply with quote

Computational Items
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Dec 02, 2002 5:59 am    Post subject: Reply with quote

Hi Kolusu,

Can you provide me with some more information on COMP-4 and COMP-5. The COBOL book that I use them does not list them. And COMP-4 seems identical with COMP-1. And is COMP-5 used in COBOL on mainframes.
Personally, I have never seen COMP-4 and COMP-5 in production programs.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Mon Dec 02, 2002 6:38 am    Post subject: Reply with quote

Comp-4 is the same as BINARY, not Comp-1 which is single precision floating point (4 bytes). Comp-5 is native binary which can handle halfwords, fullwords or 64 bit integers.

From the manual

Quote:
These data items are represented in storage as binary data. The data items can contain values up to the capacity of the native binary representation (2, 4 or 8 bytes), rather than being limited to the value implied by the number of nines in the picture for the item (as is the case for USAGE BINARY data). When numeric data is moved or stored into a COMP-5 item, truncation occurs at the binary field size, rather than at the COBOL picture size limit. When a COMP-5 item is referenced, the full binary field size is used in the operation.

_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Dec 02, 2002 7:13 am    Post subject: Reply with quote

Sorry Dave, I mistakenly put COMP as COMP-1.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Mon Dec 02, 2002 7:25 am    Post subject: Reply with quote

No worries. If you were to write a interface to an assembler, C/C++ or PL/1 program then comp-5 is a good choice for mapping integer fields. Otherwise, COBOL might truncate fields it shouldn't...
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group