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

Delete dup with particular value at desired location


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Dec 07, 2006 2:17 am
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
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 Developer


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

PostPosted: Thu Dec 07, 2006 10:33 pm
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
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 Developer


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

PostPosted: Sat Dec 09, 2006 3:54 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Delete file row if blanks in the firs... DFSORT/ICETOOL 5
Search our Forums:

Back to Top