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


Please Help Members By Posting Answers For Below Questions

How are the next sentence and continue different from each other?

766


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

644


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

676


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

1933


What is the difference between PIC 9.99 and PIC9v99?

782






What is the difference between comp and comp-3 usage?

681


Differentiate between structured cobol programming and object-oriented cobol programming.

669


What are the various section in data division and briefly explain them.

700


Can a Search can be done on a table with or without Index?

804


Write the code to count the sum of n natural numbers.

701


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

748


What is Pic 9v99 Indicates in COBOL?

729


How many bytes S(8) comp field occupy and its maximum value?

1634


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?

6834


what is difference between cobol and cobol/400

21567