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

What is the reference modification.

2 Answers  


Please let me know at which Scenarios we will go for STATIC call or DYNAMIC

3 Answers   IBM,


1)what is use of linkage section? 2)what is difference between comp and comp-3

1 Answers   Cap Gemini,


can we use go to statement inline-perform?

7 Answers   IBM,


Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.

2 Answers   RBS,


How many sections are there in data division?.

10 Answers   Amdocs, TCS,


What are declaratives and what are their uses in cobol?

0 Answers  


if a file has 1000 recods how copy the records from 1 to 100 records using sort

4 Answers   IBM,


can we display comp-3 variables. if we want to display what we have to do . give me one example

6 Answers   CGI, Deloitte,


Can we use icetool in cobol program?

3 Answers  


Should I use STOP RUN in the sub program??why?

6 Answers   Xansa,


how the control comes back from subprogram to mainprogram

3 Answers   IBM,


Categories