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

I have a File that has duplicate records. I need only those records that occur more than thrice.?

8603


Write some characteristics of cobol as means of business language.

610


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

1871


What are declaratives and what are their uses in cobol?

700


Are you comfortable in cobol or jcl?

633






What are the different types of condition in cobol and write their forms.

649


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

812


What are literals?

622


What is rmode(any) ?

676


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

1916


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

671


How to remove 2 duplicate records and copy only one using job control language?

729


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

699


In COBOL programming, what is PERFORM? What is VARYING?

664


Difference between array and sub-script ?

1151