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 reference modification.
Please let me know at which Scenarios we will go for STATIC call or DYNAMIC
1)what is use of linkage section? 2)what is difference between comp and comp-3
can we use go to statement inline-perform?
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
How many sections are there in data division?.
What are declaratives and what are their uses in cobol?
if a file has 1000 recods how copy the records from 1 to 100 records using sort
can we display comp-3 variables. if we want to display what we have to do . give me one example
Can we use icetool in cobol program?
Should I use STOP RUN in the sub program??why?
how the control comes back from subprogram to mainprogram