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
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
how do you define single dimensional array and multidimensional array in your cobol?
Write a program to explain size error.
What are declaratives and what are their uses in cobol?
Why would you use find and get rather than to obtain?
What is the LINKAGE SECTION used in COBOL?
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
Write some characteristics of cobol as means of business language.
What is rmode(24)
What is inspect in cobol ?
What are the different rules to perform a Search?
What is link edit in cobol?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......