Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Logic to eliminate the duplicates in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Logic to eliminate the duplicates in cobol
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    Post subject: Re: Hai please help me to eliminate duplicate
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    Post subject: Thank you very much sir
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Dec 27, 2006 3:35 pm    Post subject:
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

Site Director


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

PostPosted: Thu Dec 28, 2006 4:41 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us