Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Comp interview questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Deepak1518780

New User


Joined: 14 Jun 2018
Posts: 2
Location: India

PostPosted: Sat Sep 22, 2018 7:26 pm    Post subject: Comp interview questions
Reply with quote

In an interview, I was asked what is use of comp,comp1,comp2
In real word.Where we need need to define variable using comp, comp1, comp2
Pls revert me.

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

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8400
Location: Dubuque, Iowa, USA

PostPosted: Sun Sep 23, 2018 3:02 am    Post subject: Reply to: Comp interview questions
Reply with quote

I think you might do better on Beginners and Students Forum as this forum is for experts, and your question is definitely a beginner's question.

COMP-1 and COMP-2 are short and long floating point respectively. You would use them when you need the larger values (but less precision) that floating point allows you.

COMP is integer binary. You would use COMP for counters, subscripts, and the like where you don't want to take the resources required to convert into and out of zoned decimal for arithmetic.

COMP-3, which you did not mention, is packed decimal and is often used for arithmetic variables as well since there is no need for conversion (which the compiler will do automatically) before the value can be used in a COMPUTE (or other arithmetic) statement.
Back to top
View user's profile Send private message
Deepak1518780

New User


Joined: 14 Jun 2018
Posts: 2
Location: India

PostPosted: Sun Sep 23, 2018 7:31 am    Post subject:
Reply with quote

Thanks for reply, I want t know where we need to define comp1 and comp2.

Thanks
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2098
Location: UK

PostPosted: Sun Sep 23, 2018 3:32 pm    Post subject: Reply to: Comp interview questions
Reply with quote

Quote:
I want t know where we need to define comp1 and comp2

Please read and understand the answers given to you. Robert's reply gave you this information.

Please also refer to the COBOL Language Reference Manual - available via the links in the forum (very top line) or by googling.

Topic moved to the interview questions part of the forum.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8400
Location: Dubuque, Iowa, USA

PostPosted: Sun Sep 23, 2018 6:12 pm    Post subject:
Reply with quote

Quote:
Thanks for reply, I want t know where we need to define comp1 and comp2.
Where? You define them in a COBOL program, in the LINKAGE SECTION or FILE SECTION or WORKING-STORAGE SECTION.

And if you don't know what a floating point variable is, then you DEFINITELY do not belong in this forum but in the Beginners forum instead.
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 365
Location: Maryland

PostPosted: Sun Sep 23, 2018 7:37 pm    Post subject: Re: Reply to: Comp interview questions
Reply with quote

Robert Sample wrote:
I think you might do better on Beginners and Students Forum as this forum is for experts, and your question is definitely a beginner's question.

COMP-1 and COMP-2 are short and long floating point respectively. You would use them when you need the larger values (but less precision) that floating point allows you.

COMP is integer binary. You would use COMP for counters, subscripts, and the like where you don't want to take the resources required to convert into and out of zoned decimal for arithmetic.

COMP-3, which you did not mention, is packed decimal and is often used for arithmetic variables as well since there is no need for conversion (which the compiler will do automatically) before the value can be used in a COMPUTE (or other arithmetic) statement.

I'm seriously in doubt if the TS has any idea of the following:
- floating point,
- larger values,
- less precision,
- integer binary,
- counters, subscripts,
- resouces required,
- convert into and out,
- zoned decimal,
- arithmetic,
- packed decimal,
- conversion,
- compiler,
- automatically,
- the value,
- compute,
- statement.

So, the explanation of three unclear words by using 33 more unclear words doesn't make any sense... sterb050.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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace comp-3 field value to comp-3 ... dharmaraok DFSORT/ICETOOL 5 Fri Sep 14, 2018 3:46 pm
No new posts How can we create a flat file in JAVA... jasorn Java & MQSeries 2 Wed Aug 08, 2018 3:08 pm
No new posts Comparing Comp-3 fields with greater ... Prateeksichem1 DFSORT/ICETOOL 11 Fri Jul 13, 2018 8:45 am
No new posts A couple of Interview Questions on Co... viplavmodi36 Mainframe Interview Questions 5 Fri Feb 23, 2018 6:21 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us