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
 

 

Practical use of comp and comp-3

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

New User


Joined: 09 Apr 2008
Posts: 14

PostPosted: Thu Sep 02, 2010 4:03 pm    Post subject: Practical use of comp and comp-3
Reply with quote

I know the difference between a comp and and comp-3 variable. Could some1 please tell me in what all scenarios the usage comp and comp-3 is preferred?
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 02, 2010 4:56 pm    Post subject:
Reply with quote

All? That would take some time. I could devote an hour of my day to you, or ...

Have you done any research yourself - I'm just guessing this is a topic that others have already written about, either here or elsewhere (read "world wide web") dontcha think?[/i]
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Sep 02, 2010 5:08 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

You should consult with some of your more Senior Tech's at your site. I'm sure they can give you some sound answers, which you need to run with.

As far as your request, you need to spend time researching this on your own, because an extensive explanation (as Phil has said) is time consuming and is above and beyond what members provide (and for free).

Remember, we are a Help board and members need to put in an effort in an attempt to resolve their questions before posting. If you do this and provide your findings in a given post, you'll find that other members are more receptive and more willing to lend a hand.

Thank You,

Bill
Back to top
View user's profile Send private message
anjoos20

New User


Joined: 09 Apr 2008
Posts: 14

PostPosted: Thu Sep 02, 2010 5:24 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

From my research: Comp variables are used as counters and should be integers. Comp-3 variables are used for numeric data like amounts and decimal points are allowed.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 02, 2010 5:26 pm    Post subject:
Reply with quote

Your "research" is flawed.
Back to top
View user's profile Send private message
anjoos20

New User


Joined: 09 Apr 2008
Posts: 14

PostPosted: Thu Sep 02, 2010 5:53 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

Thanks..
Back to top
View user's profile Send private message
baichunli2010

New User


Joined: 26 Aug 2010
Posts: 3
Location: China

PostPosted: Thu Sep 02, 2010 7:19 pm    Post subject:
Reply with quote

when you use the db2 database, the data type maybe :
decimal(m,n) -----> pic s9(m-n)vn comp-3.
smallint -----> pic 9(04) comp.
integer -----> pic 9(09) comp.

however, comp-3 always used to represent amount when comp is used
for counter and address.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 02, 2010 8:26 pm    Post subject:
Reply with quote

Hello,

Quote:
From my research: Comp variables are used as counters and should be integers. Comp-3 variables are used for numeric data like amounts and decimal points are allowed.


Quote:
Your "research" is flawed.
Or at least incomplete. . .

Quote:
Could some1 please tell me in what all scenarios the usage comp and comp-3 is preferred?
If you mention a few specifics, someone may have a suggestion for these specifics (and these suggestions will not always agree. . .).
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 02, 2010 8:30 pm    Post subject:
Reply with quote

I'll agree to "incomplete," but suggest that incomplete ==> flawed in the context of a newby who would accept another newby's "research" as gospel.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 02, 2010 9:50 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

Hi Phil,

Quote:
flawed in the context of a newby who would accept another newby's "research" as gospel.
It is quite scary the "things" that people will accept simply because someone else (with even less knowledge) posted them. . .

Brrr (shiver). . .

d
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 02, 2010 10:58 pm    Post subject:
Reply with quote

My research shows that 3+1 = 10.

[I forgot to tell you I use base 3 arithmetic.]
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Sep 02, 2010 11:02 pm    Post subject:
Reply with quote

Uh, in base 3 wouldn't 10 represent 3?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 02, 2010 11:17 pm    Post subject:
Reply with quote

Robert Sample wrote:
Uh, in base 3 wouldn't 10 represent 3?


picky, picky, picky!
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Sep 02, 2010 11:28 pm    Post subject:
Reply with quote

My research is flawed.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 02, 2010 11:55 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

Quote:
My research is flawed.
He replied flawlessly. . .
Back to top
View user's profile Send private message
santy
Warnings : 1

New User


Joined: 19 Jul 2007
Posts: 22
Location: mumbai

PostPosted: Tue Sep 07, 2010 2:03 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

people,

as u all r sr. b'cos more exprience and resarch people compare to others,

but i think the ans given by baichunli2010 was also correct. Also this ans in not enough to solve anjoos20 question.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Sep 07, 2010 2:05 pm    Post subject: Reply to: Practical use of comp and comp-3
Reply with quote

Quote:
as u all r sr. b'cos more exprience and resarch people compare to others,


please translate to something that we can understand
it is not proper to use sms/kiddie jargon icon_evil.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 07, 2010 8:02 pm    Post subject:
Reply with quote

Hello,

Quote:
Also this ans in not enough to solve anjoos20 question
Which question? The original?
anjoos wrote:
Could some1 please tell me in what all scenarios the usage comp and comp-3 is preferred?
The first reply is the answer:
Phil wrote:
All? That would take some time.


We do not support the "tell me everything about. . ." questions. There simply is not time/space/willingness to do so. If someone wants "everything" they need to do the research and post here when there is some question/doubt.

Or did you have something else in mind. . .
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Mon Sep 13, 2010 6:53 pm    Post subject:
Reply with quote

this will give you some brief idea about Numeric data processing features in Cobol.

http://ibmmainframes.com/about393.html

Let know for any more details icon_exclaim.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 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 comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm


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