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 |
how to access vsam files in cobol and how to differentiate that this is ESDS file
wht is the difference between goto and perform stmts
How to retain the Duplicates in the one records?
How can you get the ksds file records into your cobol program?
how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).
Can we put move statement in COBOL copybook
How to read the last 100 records from a COBOL file. The file contains N number of records.
What are the access modes of START statement?
What is "Call by content" and "call by reference"?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
what happens if parmparameter passes zero bytes to the program
how do u list the abended jobs?