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
 

 

Delete dup with particular value at desired location

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ujangala

New User


Joined: 17 Oct 2006
Posts: 3
Location: Hyd, India

PostPosted: Thu Dec 07, 2006 12:17 am    Post subject: Delete dup with particular value at desired location
Reply with quote

Frnds,

Can someone help me with this issue.

I want to delete a duplicate record which is having particular value at desired location. For example.....

01keyThisisaGoodrecord.
01keyThisisaBad record.

In the above two records, the key (1-5) is same, I need to delete the second record which is having 'Bad' in that position.

I used SUM FIELDS=NONE. This always keeps FIRST record, which is not serving my purpose.
Please help me.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 07, 2006 2:17 am    Post subject:
Reply with quote

Hmm ... it's not very clear what you want to do and your example isn't a very good one considering that SUM FIELDS=NONE will give you the first record and delete the second record which would give you the results you're asking for. I think you want to extract just the duplicate records and then delete the ones with 'Bad'. For example, if the input is:

00keyThisisaGoodrecord.
01keyThisisaGoodrecord.
01keyThisisaBad record.
02keyThisisaBad record.
02keyThisisaGood record.

You'd want the output to be:

01keyThisisaGoodrecord.
02keyThisisaGood record.

If that's what you want to do, then you can use this DFSORT/ICETOOL job:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,5,CH) ALLDUPS USING(CTL1)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,OMIT=(13,3,CH,EQ,C'Bad')
/*


If that's not what you want to do, then you need to explain more clearly what you want to do and show a better example of your input records and what you want for the output records.
Back to top
View user's profile Send private message
ujangala

New User


Joined: 17 Oct 2006
Posts: 3
Location: Hyd, India

PostPosted: Thu Dec 07, 2006 7:46 am    Post subject:
Reply with quote

Hi Frank,

Thanks for your reply.

your understanding abt my problem is correct. Let me be more clear on this.

I am merging two files (File1 & File2) and then sorted the output(OutFile) on the key. File2 records contains a particular word (lets say BAD) for all the records. If the OutFile contains duplicates, then I need to delete only the records which contain the word 'BAD'.

I want to place this logic in a Proc.
Please try and help me on this.

Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 07, 2006 10:33 pm    Post subject:
Reply with quote

Quote:
your understanding abt my problem is correct.

Please try and help me on this.


If my understanding is correct, then I already gave you a DFSORT job to do what you want to do. So what further help are you requesting?
Back to top
View user's profile Send private message
ujangala

New User


Joined: 17 Oct 2006
Posts: 3
Location: Hyd, India

PostPosted: Sat Dec 09, 2006 12:46 am    Post subject:
Reply with quote

Thanks for your solution.

With this logic, I am getting only the records which have dups. But I also need nondup records in my output.

Now I am doing it in two steps using ALLDUPS and NODUPS, and then merging the two outputs.

Please tell me if there is any other way to do it.

Also Thanks for guiding me on this.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Dec 09, 2006 3:54 am    Post subject:
Reply with quote

I don't understand what you want. For the situation where you're not getting what you want, please show me an example of your input records, the output records you're getting with my job and the output records you want.

It's really difficult to help you when you don't give the details of what you want. Your original post just showed dups for input with no mention of nodups. I showed an example with dups and nodups for input and just the dups for output. You didn't say that's not what you wanted. Now you say you want nodups, but you don't show any example of what you want.
I can't read your mind. Please help me help you by giving complete details of what you want.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Delete record or Reset RC code using ... mpawan Compuware & Other Tools 4 Tue Jul 26, 2016 3:52 pm
No new posts Mainframe opening for 3 to 10 yrs exp... Placementatpune Mainframe Jobs 0 Tue Jul 05, 2016 12:02 pm


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