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 comp and comp-3?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
HOw can I get the negative sign while deduct high value from low value
What is difference between static and dynamic call in cobol?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
In COBOL programming, what is PERFORM? What is VARYING?
What is the difference between binary search and sequential search?
What is redefines clause in COBOL?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
How you can characterize tables in cobol?
what is the difference between COBOL2 AND COBOL390?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
When is inspect verb is used in cobol?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc