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 / suersh ramaiyan
Use REDEFINE.
Example:
01 NUMBER-X PIC X(10).
01 NUMBER-N REDEFINES NUMBER-X
PIC 9(10).
COMPUTE A = NUMBER-N + B
This will surely work.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
How are the next sentence and continue different from each other?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
What is the difference between PIC 9.99 and PIC9v99?
What is the difference between comp and comp-3 usage?
Differentiate between structured cobol programming and object-oriented cobol programming.
What are the various section in data division and briefly explain them.
Can a Search can be done on a table with or without Index?
Write the code to count the sum of n natural numbers.
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What is Pic 9v99 Indicates in COBOL?
How many bytes S(8) comp field occupy and its maximum value?
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
what is difference between cobol and cobol/400