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
 

 

what is the need of Comp-3 in cobol

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

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Mon Oct 30, 2006 1:53 pm    Post subject: what is the need of Comp-3 in cobol
Reply with quote

HI,
Comp variables use less storage compared to COMP-3
as well as processing comp variables will be faster than comp-3(i guess)
then what might be the reason that comp-3 came into existence.....

Is comp-3 originated before comp..
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Mon Oct 30, 2006 2:18 pm    Post subject:
Reply with quote

Hi !

Different amounts of money can be stored positive or negative.
Therefor they are declared as comp-3 because of the leading sign.

Comp variables don't have that sign included.

Regars, UmeySan
Back to top
View user's profile Send private message
prashanth1

New User


Joined: 27 Sep 2006
Posts: 47
Location: Hyderabad

PostPosted: Mon Oct 30, 2006 2:28 pm    Post subject:
Reply with quote

I think , your assumptions are wrong.

COMP

1-4 Digits occupies 2 bytes of memory (half-word)
5-9 Digits occupies 4 bytes of memory (full-word)
10-18 Digits occupies 8 bytes of memory(double-word)


COMP-3

9 digits will be stored in 5 bytes (n/2+1)

18 digits will be stored in 10 bytes


Means that , all these should be depend on their boundaries.


Pls correct Me, If I wrng icon_smile.gif
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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am


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