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
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What is amode(31)
What are the various section in data division and briefly explain them.
What is the local-storage section?
Can we change the password using ALTER? anyone tried and changed?
what is amode(24), amode(31), rmode(24) and rmode(any)?
how do you reference the rrds file formats from cobol programs
how do you reference the ksds vsam file formats from cobol programs
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
how can i see junk values in dclgen or in hostvariable of comp ?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
what is the difference between COBOL2 AND COBOL390?
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
Write the code to count the sum of n natural numbers.
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?