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 |
record length in spool?
What is SDSF?
What is ASKTIME, SUSPEND
HI THIS IS ANIL. HOW TO PASS A RECORDS OF A FILE(PS OR PDS) TO AN ARRAY?
What is XDC ?
How do u know what version of cobol u are using?
How to solve SOC7. I have the cobol coded as below 01 A PIC 9(4). 01 AIN REDEFINES A. 05 AIN1 PIC S9(4) 01 B PIC 9(4)V99. 01 BIN REDEFINES B. 05 BIN1 PIC S9(4)V99. PROCEDURE DIVISION. START-PARA. INITIALIZE A AIN B BIN. ACCEPT A B. DISPLAY 'VALUE OF A=' A. DISPLAY 'VALUE OF B=' B. DISPLAY 'VALUE OF BIN1=' BIN1. DISPLAY 'VALUE OF AIN1=' AIN1. COMPUTE AIN1 = BIN1 - AIN1. DISPLAY 'VALUE OF AIN1=' AIN1. When i'm executing this code i'm getting SOC7 for A = 12 & B=34. Can someone explain SDSF OUTPUT DISPLAY TCOM058R JOB05458 DSID 102 LINE 0 COLUMNS 02- 81 COMMAND INPUT ===> SCROLL ===> CSR ********************************* TOP OF DATA ********************************** VALUE OF A=12 VALUE OF B=34 VALUE OF BIN1=34 VALUE OF AIN1=12 CEE3207S The system detected a data exception (System Completion Code=0C7). From compile unit PROG1 at entry point PROG1 at statement 29 at compile +000004CE at address 00007ECE. Please address how to solve this issue Thanks in advance.
I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?
i have the job which has written updated 100 records into the table and for 101th record it got abended and i want to start the job again and should wirte from 101th record not from 1st record..how to do it..?
what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?
How to display the index.(displacement from an array)
if you code move high-values to variable,can you move it into numeric variable or alphanumeric variable?