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
I have a File that has duplicate records. I need only those records that occur more than thrice.?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What is cobol?
What are the different open modes available in cobol?
What are the cobol coding sheets?
How do you reference the following file formats from cobol programs?
What is the difference between Global and External Variables?
Describe the cobol database components?
What is length is cobol?
What is the LINKAGE SECTION used in COBOL?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
In COBOL programming, what is PERFORM? What is VARYING?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this