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 search and searchall?what is the diffrence between them?give an best example?

6679


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3213


What are the different open modes available in cobol?

1148


How you can characterize tables in cobol?

1151


What rules are followed by the search verb.

1056


What is report-item in COBOL?

1101


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

2085


Write some characteristics of cobol as means of business language.

1083


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1606


What is Pic 9v99 Indicates in COBOL?

1183


What is amode(31)

1113


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

2398


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

1060


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17803


How to know whether the module is dynamical or statistical?

1087