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

I have a File that has duplicate records. I need only those records that occur more than thrice.?

9874


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

863


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

1237


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

1318


What is cobol?

1238


What are the different open modes available in cobol?

1187


What are the cobol coding sheets?

1264


How do you reference the following file formats from cobol programs?

1156


What is the difference between Global and External Variables?

1374


Describe the cobol database components?

1169


What is length is cobol?

1097


What is the LINKAGE SECTION used in COBOL?

1524


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1293


In COBOL programming, what is PERFORM? What is VARYING?

1144


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

1533