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

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

1193


What is Pic 9v99 Indicates in COBOL?

1238


How arrays can be defined in COBOL?

1191


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

1514


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

1098


Difference between cobol and cobol-ii?

1254


What is the difference between binary search and sequential search?

1071


) How do u handle errors in BMS macro?

1939


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

6544


What is the difference between Call and a Link?

1175


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

2519


What is the LINKAGE SECTION used in COBOL?

1515


What is the difference between a binary search and a sequential search what are the pertinent cobol?

1131


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

1189


What is the use of intialize verb?

1221