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
How to use the same COBOL program in Batch and CICS on lines? explain with an example
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
How do u write test cases?
What the difference is between continue and next sentence?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
how do you reference the rrds file formats from cobol programs
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
example for sub strings ? and refernce modifications whit output pls
how do you define single dimensional array and multidimensional array in your cobol?
How are the next sentence and continue different from each other?
What type of SDLC u followed? Why?
In COBOL, what is the different between index and subscript?
What rules are to be followed while using the corresponding options?