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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What type of SDLC u followed? Why?

1983


How do define dynamic array in cobol.

1111


What is comp-1 and comp-2?

1215


Explain about different table spaces.

1079


For rewrite, why is it mandatory that file needs to be opened?

1088


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1151


What is the difference between perform … with test after and perform … with test before?

1412


explain sorting techniques in cobol program?

1176


What are the cobol coding sheets?

1243


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

1068


How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

1118


how do you reference the esds vsam file formats from cobol programs

1190


What is the difference between next sentence and continue in cobol programing language?

1195


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

1098


How do we get current date from system with century in COBOL?

1357