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
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 |
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 |
Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in another flat file. Could you please provide me the code in COBOL?
waht is inspect verb? where it can be in real time?
wht r the advantages of 77 level number ?
what is search and searchall?what is the diffrence between them?give an best example?
I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?
) How do u handle errors in BMS macro
what is s000 u4087 error? please give the all error codes in cobol,jcl.
what is linkcard in cobol?
what is rediffine clause?in what situation it can use?give me real time example?
can we print comp 3 stmts how ?
A table has two indexes defined. Which one will be used by the SEARCH?
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?