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

Why would you use find and get rather than to obtain?

696


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

703


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1236


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.

1707


Mention the guidelines to write a structured cobol program?

624






What are the pertinent COBOL

2053


What are the different rules to perform a Search?

619


What is redefines clause in COBOL?

853


Discuss about changing dataset name in proc.

769


What are 77 levels used for?

663


What is the difference between PIC 9.99 and PIC9v99?

787


What is the difference between next sentence and continue in cobol programing language?

716


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

681


What is comp-1 and comp-2?

768


What are different data types in cobol?

699