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 / reena

Define the working storage variable in the following way:

01 ws-var1.
05 ws-var2 pic x(1).
05 ws-var3 pic x(3).

Read the database file.

Move the database field value to the working storage
variable (i.e. ws-var1)

Then preform the following

if ws-var2 = '3'
move '5' to ws-var2
move ws-var1 to the database field
rewrite database record
end -if

read the next record.

Preform the above routine till eof..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Have you used comp and comp-3 in your project? And how?

2489


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

2087


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2440


What is a scope terminator give example?

1120


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

9112


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

1102


Explain the configuration section of a cobol program with examples of syntax.

1207


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2974


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

1179


What is report-item in COBOL?

1166


What is the difference between binary search and sequential search?

1099


Write a program to explain size error.

1204


What is a report item?

1150


Write a cobol program making use of the redefine clause.

1192


what is amode(24), amode(31), rmode(24) and rmode(any)?

1155