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 increase the logical record length of existing PS file?

7 Answers  


how will u code parm parameter and where pls ?

3 Answers   DELL,


suppose there is one PF having two members PF1 PF2.PF has one unique key Emp ID.could you tell me uniqueness in PF will be effective across members as well ? assume emp iD 3333 is in member PF1 would same Emp id be exist also in member PF2 ?

2 Answers   Tesco HSC, Wipro,


I want to declare a field with data type Double in my COBOL program. how shall i do that ?

5 Answers  


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

0 Answers  






i have two file one is ksds another one is esds i want store matching records in flat file how to you matching.

2 Answers   Wipro,


I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?

5 Answers  


study the following 01 A PIC 99V0 VALUE 5 01 B PIC 9V9 VALUE 6 01 C PIC 99V9 VALUE 2.5 01 D PIC 99 VALUE 3 COMPUTE A ROUNDED B C = A+B*C/D ON SIZE ERROR PERFORM PRINT-ERROR the comments of A.B.C after execution of the above statement are a.A=10 B=0 C=10 b.A=10 B=9.9 C=9.9 c.A=10 B=0 C=9.9 d.A=10 B=6 C=10

4 Answers   TCS,


how do u list the abended jobs?

1 Answers   IBM,


how do you define single dimensional array and multidimensional array in your cobol?

0 Answers  


which one is better among static call and dynamic call?

3 Answers  


in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 to 20 in reverse order in cobol environ ment any one please give the answer......

2 Answers   IBM,


Categories