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

Why there is no questions in this column?

6 Answers  


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


Can you please let me know the centre name of INS certification in Kolkata.

0 Answers  


Why occurs cannot be used in 01 level in COBOL?

0 Answers   Arigo Infotech,


How can we increase the size of an existing PDS to include more no. of modules. I tried the answer posted by Jagan(TSO PDS 'pds name') but did not find it working. The answer posted by kamal i know very well. Please suggest me a answer so that we don't need to delete the existing PDS and still we can change the size as well.

10 Answers  






Explain about different table spaces.

0 Answers  


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

0 Answers  


What is the difference between copy and include in cobol?

1 Answers  


what is mainframe? what is the mainframe software ? what is use in s/w field?

7 Answers   CSE,


If I want to increase the Limit in GDG. What should I do?

1 Answers   IBM,


What kind of error is trapped by on size error option?

0 Answers  


where did you see the information regarding abend codes in jcl?

1 Answers   Hewitt,


Categories