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

What do you understand by passing by reference and passing by content?

1 Answers  


what are the utilities for load and unload the DB2 tables

1 Answers   L&T,


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


What is perform what is varying?

0 Answers  


What is the difference between binary search and sequential search?

0 Answers  






how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

0 Answers   HSBC, Quest,


What are literals?

0 Answers  


TYPES OF SORTINGS. which is more prefarable.

2 Answers   Syntel, TCS,


I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?

5 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  


How do you do in-line PERFORM?

4 Answers   Accenture,


What is IMPACT analysis?

2 Answers   IBM,


Categories