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

You can solve this problem using the Referencial Intigrity.

Let consider these extension no. in WS section.
01 WS-EXTN PIC X(4).

IF WS-EXTN(1,1)='3'
ISPECT WS-EXTN replacng first '3' by '5'
END-IF.

read the next record.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many sections are there in data division in COBOL?

679


how can i see junk values in dclgen or in hostvariable of comp ?

2544


Difference between array and sub-script ?

1169


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3720


What rules are followed by the search verb.

638






input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

1783


What are various search techniques in cobol? Explain.

650


What are the various section in data division and briefly explain them.

700


What are the different data types in cobol?

797


What is a scope terminator give example?

657


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

748


Can we change the password using ALTER? anyone tried and changed?

1549


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

1885


What rules are to be followed while using the corresponding options?

641


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

1715