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
 

 

use of COMP variables

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

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Fri Jan 20, 2006 2:35 am    Post subject: use of COMP variables
Reply with quote

Hi,

We know that COMP-3 variables are better than COMP variables as it requires less storage. But we also colde COMP variables in COBOL programs. Can anybody tell me why do we go for COMP variables. Is the storage only criterion or there any differences?

Thank you,
Brahma
Back to top
View user's profile Send private message

jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Fri Jan 20, 2006 8:06 am    Post subject:
Reply with quote

COMP variables take less sapace since they are binary variables. Comp variables are more effcient as count variables and as a subscript.
Back to top
View user's profile Send private message
bsriramulu
Warnings : 2

New User


Joined: 20 Jan 2006
Posts: 8

PostPosted: Tue Jan 24, 2006 10:48 am    Post subject: How to find out the record length using tso command?
Reply with quote

Hi ,
Any body pls give me reply urgent.

with cheers,
sriram.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Tue Jan 24, 2006 11:15 am    Post subject:
Reply with quote

Hi,

s9(4)comp is small integer ,so two words equal to 8 bytes. Totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 bytes totally it will occupy 3 bytes
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Tue Jan 24, 2006 12:35 pm    Post subject: Re: use of COMP variables
Reply with quote

brahmanandareddy wrote:
Hi,

We know that COMP-3 variables are better than COMP variables as it requires less storage. But we also colde COMP variables in COBOL programs. Can anybody tell me why do we go for COMP variables. Is the storage only criterion or there any differences?

Thank you,
Brahma



hai Brahma,

we go for differnet usage clauses depending on the requirement. Basically COMP variables are used when we need to store subscripts. They serve a good purpose as count variables.

COMP-3 variables are used to reduce the storage as some have said in the posts. Note the major difference lies is the storage of sign. COMP variables do not have a separate storage for sign wherein COMP-3 variables have. Even if you've not specified the SIGN CLAUSE in COMP-3 variable, the right most half nibble is dedicated for sign storage. In case of COMP varibales, the sign is stored embedded with no separate storage.

corrections welcomed.....

gowtham
Back to top
View user's profile Send private message
ksrujan

New User


Joined: 24 Jan 2006
Posts: 4

PostPosted: Wed Jan 25, 2006 11:49 am    Post subject:
Reply with quote

hai Brahma,

If you want to know more about COMP here is the link.
http://www.discinterchange.com/TechTalk_COBOL_comp_.html

Thanks,
Srujan
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm


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