Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?



I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried..

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

Post New Answer

More COBOL Interview Questions

perform I from 0 by 1 until I=5?How maney times it will executes

8 Answers  


Have you used comp and comp-3 in your project? And how?

0 Answers   IBM,


How does IDMS communicate with CICS?

1 Answers   Covansys, Satyam,


can i give 9(10) in comp 3 instead of s9(10) ? if i can give wht would be ths ans

2 Answers   DELL,


WHY LRECL NEEDS TO BE 4 EXTRA THEN THE COBOL FILE LENGTH & WHAT IT CONTAIN IN THAT LENGTH

2 Answers   Cap Gemini,


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

0 Answers  


Write a cobol program making use of the redefine clause.

0 Answers  


Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?

6 Answers   ABC, IBM, Mphasis, Wipro,


In a program, there are 2 sections defined say SECTION-A and SECTION-B. There is a paragraph say CALC-INT in both the sections. If this para has to be called directly for SECTION-A, then PERFORM CALC-INT will not work as it is present in both sections. How the PERFORM statement has to be coded here?

5 Answers  


Which division and paragraphs are mandatory for a COBOL program?

0 Answers  


If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


what will happen if pass values more than 100 using PARM parameter?

1 Answers  


Categories