I want to remove a duplicates form a given input field using cobol program. please Any one help me out to solve this ... Thanks in Advance.

Answer Posted / meghraj hulawale

Procedure Division.
1.Open vsam file as INPUT mode.
2. Copy the records of VSAM FILE into Table or Array by using occurs clause.
3.Count no. of records in VSAM FILE.
4.By using perform statement.
e.g
perform until I < vsam-cnt
read vsam file
perform until j < no-of-records in table or vsam-cnt
if vsam-data NOT =Table-record
A. Open another Output file as OUTPUT mode.
B. Write output file.
end-if.
increase the value of j as 1.
end-perform.
increase the value I as 1.
end-perform.
Stop run.

******Note
We need to access vsam as sequential.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

707


how do you reference the rrds file formats from cobol programs

802


What is redefines clause in COBOL?

851


How to know whether the module is dynamical or statistical?

656


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

681






Mention the guidelines to write a structured cobol program?

620


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

1949


Write a program to explain size error.

677


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1808


Write some characteristics of cobol as means of business language.

621


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

815


Name the sections present in data division.

701


Name some of the examples of COBOl 11?

2688


What is the difference between PIC 9.99 and PIC9v99?

783


What is the difference between binary search and sequential search?

643