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 Posted / 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 |
Post New Answer View All Answers
What type of SDLC u followed? Why?
How do define dynamic array in cobol.
What is comp-1 and comp-2?
Explain about different table spaces.
For rewrite, why is it mandatory that file needs to be opened?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What is the difference between perform … with test after and perform … with test before?
explain sorting techniques in cobol program?
What are the cobol coding sheets?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
how do you reference the esds vsam file formats from cobol programs
What is the difference between next sentence and continue in cobol programing language?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
How do we get current date from system with century in COBOL?