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 |
What are the different data types available in COBOL?
input:-AABBCCDDEFGHIIJ output:- ABCDEFGHIJ Here in input we hav the duplicate characters i.e repeating characters.SO we should eliminate the duplicate characters and should display the output in ascending order.
Can a Search can be done on a table with or without Index?
i friends greetings to the day...!!! I face a quation like"while runnig the programe every day i have to access the previous day updates only...!! Ex:- Let last day 100 customers took bank account i have to select those customers only.."
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
Name the sections present in data division.
how to display the dataset information?
What are the access modes of START statement?
how to know that the file has 300 records how to acess it?
Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.
How to pass return codes from cobol to jcl?
what is jcl approach for programming?