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 the file which is having the extension no as records.
sample file will look like below.

2310
3410
3256
4350
3781
5408

I need to replace the record which is starting with 3 to 5
(i.e) 3410 to 5410. How can we do it through cobol

and cobol-db2 program? I need the possible logic?

Answer Posted / thavasi

The answer is:

move each record to WS-REC PIC X(04).


then write the below statment to be executed for each rec.

INSPECT WS-REC REPLACING LEADING '3' by '5'.

why am i using LEADING instead of FIRST is that the
requirement says that 'STARTING with 3 by 5'

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1280


What are literals?

1185


What is the utilization of copybook in cobol?

1277


What are the different types of condition in cobol and write their forms.

1154


How to print 10 to 1 if the input have only 10 digit number?

1308


How do you define a variable of comp-1 and comp-2?

1260


What rules are followed by the search verb.

1199


Define static linking and dynamic linking.

1272


How can you get the ksds file records into your cobol program?

1138


Differentiate between structured cobol programming and object-oriented cobol programming.

1214


Why would you use find and get rather than to obtain?

1264


What kind of error is trapped by on size error option?

1293


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

2286


What is the LINKAGE SECTION used in COBOL?

1603


Explain about different table spaces.

1155