IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Logic to eliminate the duplicates in cobol


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arunbask
Currently Banned

New User


Joined: 12 Apr 2006
Posts: 7
Location: Chennai

PostPosted: Tue Jul 25, 2006 6:30 am
Reply with quote

HAI given input number is 1,2,2,3,4,4,5
and give me the logic to eliminate the duplicate in cobol.
Back to top
View user's profile Send private message
Sathyan_pune

New User


Joined: 27 Mar 2006
Posts: 2
Location: Pune

PostPosted: Tue Jul 25, 2006 9:56 am
Reply with quote

1. Sort the given items in ascending / desceding order

2. Read the first item, move to output file / table and consider it as cur-item

3. Read the next item, if eof stop the process

4. compare with cur-item, if both are equal go to step 3 to read next item

5. if both are not equal, move the item to output file / table and make it as cur-item, go to step 3
Back to top
View user's profile Send private message
arunbask
Currently Banned

New User


Joined: 12 Apr 2006
Posts: 7
Location: Chennai

PostPosted: Wed Jul 26, 2006 12:19 am
Reply with quote

Thank you very much sir
Back to top
View user's profile Send private message
harish_mf

New User


Joined: 31 Jul 2005
Posts: 18
Location: bangalore

PostPosted: Wed Dec 27, 2006 3:16 pm
Reply with quote

for the same query listed above please code it its urgent.

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 27, 2006 3:35 pm
Reply with quote

harish_mf wrote:
for the same query listed above please code it
Code what? In what language? Are you not a programmer?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 28, 2006 4:41 am
Reply with quote

Hello,

Frank Yeager posted this on the DFSORT forum. Someone there needed to eliminate duplicates.

Code:

//S2 EXEC PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=(1,19,CH,A)
  OPTION EQUALS
  SUM FIELDS=NONE
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top