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

What is rmode(any) ?

688


What is the difference between binary search and sequential search?

643


Define static linking and dynamic linking.

669


What is the difference between next sentence and continue in cobol programing language?

712


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

6841






i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2109


How to print 10 to 1 if the input have only 10 digit number?

815


how do you reference the variable unblock file formats from cobol programs

754


Write a program that uses move corresponding.

676


What is the problem of ordered sequential files access?

704


What is the difference between comp and comp-3?

704


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1775


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

674


How do you define a variable of comp-1 and comp-2?

709


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

720