I have a field with data type X(10). I want to perform
arithmetic operation on this field? I tried doing it by
moving the value into a numeric field. but it didn't work
out. I am getting a S0C7 abend. Pls let me know if there is
any way of getting this done?
Answer / quasar chunawala
You cannot perform Arithmetic Operations on Textual
Character Data.
01 WS-TEXT PIC X(02) VALUE '15'.
ADD +1 TO WS-TEXT
This is a S0C-7(Data Exception in COBOL).
If you still want to acheive this effect, I suggest you do
it this way -
01 WS-TEXT PIC X(02) VALUE '15'.
01 WS-NUMBER REDEFINES WS-TEXT PIC 9(02).
ADD +1 TO WS-NUMBER
| Is This Answer Correct ? | 10 Yes | 0 No |
What is the file organization clause ?
When and how can we use index & subscript ?
If my file contains 100,000 records and job abended at 55,000th records processing then how can i restart job from that record onward by ignoring that record. I can not edit the file as file size is big and it is getting browse substituted?
How to covert given string into ASCII value in COBOL/MF COBOL
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
what are the control characters used in reports
hi. This is Ram.i have one doubt.why can't we display comp-3 variables directly? let me answer quickly plez........
where do u use low-value and high value in cobol
in real time what is the suitable exp where in-stream procedure is better then catalog procedure.
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
how many bytes does a s9(12)COMP-4 field occupy?? a.2 b.4 c.8 d.1 ans with reason please
How to display the index.(displacement from an array)