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 is the difference between Global and External Variables?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
Are you comfortable in cobol or jcl?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
example for sub strings ? and refernce modifications whit output pls
What is comp-1 and comp-2?
What are all the divisions of a COBOL program?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What are different data types in cobol?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
In COBOL programming, what is PERFORM? What is VARYING?
In COBOL, what is the different between index and subscript?
Explain what you understand by passing by value.
how do you reference the printer file formats from cobol programs