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 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.

Answers were Sorted based on User's Feedback



I want to remove a duplicates form a given input field using cobol program. please Any one help me o..

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

I want to remove a duplicates form a given input field using cobol program. please Any one help me o..

Answer / ak

1.copy the file into array
2.read the file entil eof
3.if file-key equals to ws-arry-key(Count)
move ws-arry-key(count) to ws-dup-rec(for duplicate values)
else continue
write ws-arry-key

Is This Answer Correct ?    0 Yes 0 No

I want to remove a duplicates form a given input field using cobol program. please Any one help me o..

Answer / naveenkumar m

As few answered for VSAM file dedup, I will explain for PS flat files,

1) Make sure your file is sorted either Ascending or descending using SORT.

2)FIRST-READ PARA
READ INPUT-FILE INTO WS-ARRAY()
UNTIL EOF
ARRAY-COUNT=ARRAY-COUNT + 1

3)PERFORM COMPARE-PARA VARYING I FROM 1 BY 1 UNTIL I < ARRAY-COUNT
IF WS-ARRAY(I)=WS-ARRAY(I+1) THEN
WRITE DUPLICATE-RECORDS
ELSE
WRITE NODUPLICATE-RECORDS
END-PERFORM

=====================================
I just given algorithm not exact code....

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?

12 Answers   T systems, Tech Mahindra,


Can the OCCURS clause be at the 01 level?

2 Answers  


What is Control Break processing ?

1 Answers   iGate,


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

0 Answers  


is it possible to pass an SQL query inside a jcl which is inside a cobol program?

5 Answers   CTS,


subscript and index r not coded in u r application program what will happen?

2 Answers  


What is an index for tables?

2 Answers  


What are the differences between COBOL and COBOL II?

1 Answers   CSC,


I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,


consider the following two statements MOVE 10 TO N PERFORM PARA-X N TIMES STOP RUN PARA-X MOVE 5 TO N how many times PARA-X willbe exicuted? a.10 b.5 c.infinate d.execution error

6 Answers   ABCL, TCS,


Define static linking and dynamic linking.

0 Answers  


What is binary search?

3 Answers  


Categories