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?

Answers were Sorted based on User's Feedback



I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried..

Answer / 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

I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried..

Answer / anonymous

You cant perform any arithmetic operationon alphabetic and
alphanumeric data items . If u try to perform u ll get SOC7.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More COBOL Interview Questions

I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?

1 Answers  


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

0 Answers   HSBC, Quest,


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

0 Answers   HeadStrong,


hi friends,can any one post the ibm mainframe inteqview questions for 1year exp candidate,for itc infotech interview?. have any body attended for this in the past?...

1 Answers   ITC Infotech,


What is EIBCALEN? Why it is used?

9 Answers   ADP,






how can u pass the values into db2 values from cobol ?

3 Answers   CTS,


If we use GO BACK instead of STOP RUN in cobol?

1 Answers   Temenos,


what is the use of outrecord?

0 Answers  


What is binary search?

3 Answers  


What is the use of LINKAGE SECTION?

1 Answers  


hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,


plz any one tell clearly the justify right clause?

1 Answers  


Categories