what is the difference between Normal vaiable and comp
variable.

Answers were Sorted based on User's Feedback



what is the difference between Normal vaiable and comp variable...

Answer / suman agrawal

Using comp, the value will be stored in binary format.
The allocation in number of bytes is based on the number of
digit the variable use:

No. of digits Bytes
1-4 2 bytes
5-9 4 bytes
10-18 8 bytes

Is This Answer Correct ?    18 Yes 2 No

what is the difference between Normal vaiable and comp variable...

Answer / guest1

When you use COMNP Items, the internal storage stuctur of
the value is different. And also the storage occupied by a
COMP variable is less than the zoned variable [9(9)}.

Is This Answer Correct ?    1 Yes 0 No

what is the difference between Normal vaiable and comp variable...

Answer / garry

I am not sure about previous explanation, however before that all explanations are valid.

One thing should be clear in our mind that COMP usage is good but it can not be displayed simply, it will store in binary format, so we need to convert it in to ZD, if displaying in SYSOUT or writing to a file.

Please let me know if I am wrong.
Thanks

Garry

Is This Answer Correct ?    0 Yes 1 No

what is the difference between Normal vaiable and comp variable...

Answer / prathif

numeric data refered by pure binory storage format. it will
take half word and full word.
each character recognized by one character. total number of
chracter equal to size of word is called normal variable

Is This Answer Correct ?    0 Yes 2 No

what is the difference between Normal vaiable and comp variable...

Answer / naveen kumar.s

The value assigned to comp variable is stored in binary
format.The memeory allocation is also different.
For example,
77 A pic 9(8).
77 B Pic 9(8) comp.

Here,'A' occupies 8 bytes.whereas,'B' occupies 4 bytes only.

No.of Digits Bytes occupied

1-5 2
5-11 4
12-18 8

Is This Answer Correct ?    9 Yes 17 No

Post New Answer

More COBOL Interview Questions

Hi Guys, I have faced one interview question if I have requirement to add 5 new columns to existing table what are prerequisite do i need to take.

1 Answers  


how you will define variables length in cobol.

3 Answers   Temenos,


How do u initialize an array?

2 Answers   CTS,


I encountered an error when I move spaces to a numeric field?What should I do to move spaces on that field?help please.

9 Answers  


What is 88 level used for ?

2 Answers  






How you can read the file from bottom?

0 Answers  


What is the maximum length of a field you can define using COMP-3?

4 Answers   Complex System, Infosys,


If I want to increase the Limit in GDG. What should I do?

2 Answers   IBM,


i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk values pls say how to do ths reply fast

4 Answers   L&T,


Discuss about changing dataset name in proc.

0 Answers  


When is inspect verb is used in cobol?

0 Answers  


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

0 Answers  


Categories