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

How to recover a deleted source physical file from library?

1 Answers   HCL,


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


how we rectify soc4 and soc7 error in project(need real time answer)? please reply

3 Answers   HCL, Wipro,


I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax...

2 Answers   CTS, DSRC,


what is the difference between start and startbr?

2 Answers  






With in these three which one is the default one Call Reference, Call By Value, Call By Content.-Which one is default?

4 Answers   IBM,


If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....

1 Answers   HCL,


88 level entry is used for (a) data items in WORKING-STORAGE SECTION (b) items with RENAMES clause (c) condition-names (d) None of the above

5 Answers   TCS,


consider the following two IF statements: IF X AND NOT Y MOVE A TO B IF Z=1 OR 9 MOVE A TO B select one of the following data divusion entries which gives identical results for both the above IF statements a.01 Z PIC 9 88 X VALUE 1.9 88 Y VALUE 0.2 THRU 8 b.01 Z PIC 9 88 X VALUE 0.2 THRU 8 Y VALUE 1.9 c.01 Z PIC 9 88 X VALUE 1.9 88 NOT-Y VALUE 0.2 THRU 1.9 d.none of yhe above

3 Answers   TCS,


What is the difference between PIC 9.99 and 9v99?

7 Answers  


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

0 Answers  


Describe the difference between subscripting and indexing ?

2 Answers  


Categories