what is the difference between Normal vaiable and comp
variable.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What is the different between index and subscript?
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
How will you find the currepted records in a file
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
how do u link sub pgm to main pgm ?
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
What is an in-line perform ?
what is the use of filler in cobol programing?
how to convert the recors form vsam file to db2 table tru file aid
What is Static,Dynamic linking ?