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

Whats the difference between search & search ALL?

6374


how to refer the data field?

2211


What is the difference between Global and External Variables?

1301


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

1110


What type of SDLC u followed? Why?

1964


what happens if parmparameter passes zero bytes to the program

2085


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.

2397


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1386


What is the difference between external and global variables in COBOL?

1362


How do get the result of your program directly on your pc?

2297


Explain what you understand by passing by value.

1103


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

1295


Write the code to count the sum of n natural numbers.

1145


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1457


What are the different rules of SORT operation?

1087