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 |
When can the USING phrase be included in the call statement ?
In my table having 3000 Records. How can I delete the 500th row? (we don't know what is data inside the table)
How many sections are there in data division in COBOL?
how would find total records in files using seqientional
Can we move SPACES to numeric field and ZEROES to alphabetic field? If yes what are the way doing this?
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.
suppose a cobol programme A calling programme B,C and D. If C undergoes some change what if A,B,C,D need to be recompiled or only C nee to be recompliled.
Why do we use COMP-3 variables for computation, when we know that they are non displayable fields and require additional MOVE to numeric field before we populate it in output Reports?
wht happens if we dnt give scope terminator ?
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
how will u pass dadta to cobol+db2 program...?
in a indexed file what is procedure for read the records from 12 to 18. please give the code example