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 / quasar chunawala
You cannot perform Arithmetic Operations on Textual
Character Data.
01 WS-TEXT PIC X(02) VALUE '15'.
ADD +1 TO WS-TEXT
This is a S0C-7(Data Exception in COBOL).
If you still want to acheive this effect, I suggest you do
it this way -
01 WS-TEXT PIC X(02) VALUE '15'.
01 WS-NUMBER REDEFINES WS-TEXT PIC 9(02).
ADD +1 TO WS-NUMBER
| Is This Answer Correct ? | 10 Yes | 0 No |
01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.
IDENTIFICATION DIVISION. PROGRAM-ID. MOVEPGM. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-I PIC 9(2). PROCEDURE DIVISION. A1000-MAIN-PARA. PERFORM PARA-X WITH TEST BEFORE UNTIL WS-I= 5 STOP RUN. PARA-X. DISPLAY "BEST2". I m getting error s722,while executing the program, seems getting in loop, can anybody tell me why
What is normalisation?
What is JOBLIB and STEPLIB in JCL? what is the purpose of using it?
What is an in line PERFORM? When would you use it? Anything else to say about it?
) How do you access the migrate the data from production region to development region
What are the different forms of EVALUATE statement?
What is the LINKAGE SECTION used in COBOL?
Define cobol?
how to code in cobol while using variable block file?
consider the following piece of code 01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250
HI THIS IS ANIL. HOW TO PASS A RECORDS OF A FILE(PS OR PDS) TO AN ARRAY?