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

Removing duplicates conditionally


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 29, 2007 4:24 pm
Reply with quote

Hi,

I am using ICETOOL SELECT to remove duplicates. But now I want to include one more condition while doing so.
ie. my key fields are
key1--26,9,numeric
key2--35,9,character

If key1 = 0, i dont want the records to be skipped
My sortcard is

Code:
//TOOLIN DD *                             
SELECT FROM(IN) TO(OUT) ON(26,18,CH) NODUPS
/*                                         


Thanks in advance,
Arun
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 5:28 pm
Reply with quote

arcvns,
The following code may help you.
Code:
//TOOLIN DD *                                                     
 SELECT FROM(IN) TO(OUT) ON(26,18,CH) NODUPS USING(CTL1)         
/*                                                               
//CTL1CNTL DD *                                                   
 INREC IFTHEN=(WHEN=(26,9,ZD,EQ,0),OVERLAY=(26:C'#',SEQNUM,8,ZD))
 OUTFIL IFTHEN=(WHEN=(26,1,CH,EQ,C'#'),OVERLAY=(26:9C'0'))
/*
//       
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 29, 2007 6:06 pm
Reply with quote

Hi Shankar,

Could you plz explain what this INREC will do. Does it reformats the input before writing into output? I want to write those records with key1 = 0 as it is into the o/p file.

Thanks
Arun
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 6:20 pm
Reply with quote

INREC:
if in input file, if 26,9 equal to zeros, it will overlay with 26th position as '#' and 27,8 with sequence numbers.
OUTFIL:
wherever the '#' character found in 26th position, it will again made it to contain zeros in 26,9
Back to top
View user's profile Send private message
SCANDY

New User


Joined: 08 Aug 2007
Posts: 10
Location: Dalian, China

PostPosted: Wed Aug 29, 2007 6:57 pm
Reply with quote

There is another way to do the job.
Assume the Input and Output are also LRECL=80, RECFM=FB,
Code:
//TOOLIN DD *                                                     
 SELECT FROM(IN) TO(OUT) ON(26,18,CH) ON(81,1,CH) NODUPS USING(CTL1)         
/*                                                               
//CTL1CNTL DD *                                                   
 INREC IFTHEN=(WHEN=(26,9,ZD,EQ,0),OVERLAY=(81:C'0')),
       IFTHEN=(WHEN=NONE,OVERLAY=(81:C'1'))
 OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
//       
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 29, 2007 6:59 pm
Reply with quote

Thanks for the clarification...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 29, 2007 7:07 pm
Reply with quote

Thank you all....Where can I get a detailed reference on the abovesaid options like "IFTHEN"in ICETOOL?
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 7:56 pm
Reply with quote

SCANDY,

Please check with the code you posted. I think it will not retrieve the output as arcvns wants. correct me, if i am wrong.

arcvns,
Quote:
Where can I get a detailed reference on the abovesaid options like "IFTHEN"in ICETOOL?

Please check in the sticky.
Back to top
View user's profile Send private message
SCANDY

New User


Joined: 08 Aug 2007
Posts: 10
Location: Dalian, China

PostPosted: Thu Aug 30, 2007 7:49 am
Reply with quote

shankar.v,Thanks for your confirm, it should be:
Code:
//TOOLIN DD *                                                     
 SELECT FROM(IN) TO(OUT) ON(26,18,CH) ON(81,8,CH) NODUPS USING(CTL1)         
/*                                                               
//CTL1CNTL DD *                                                   
 INREC IFTHEN=(WHEN=(26,9,ZD,EQ,0),OVERLAY=(81:SEQNUM,8,ZD)),
       IFTHEN=(WHEN=NONE,OVERLAY=(81:C'########'))
 OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
//     


it should provided unique key for each record, whose key1=0.
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: Fri Aug 31, 2007 4:08 am
Reply with quote

Quote:
Where can I get a detailed reference on the abovesaid options like "IFTHEN"in ICETOOL?


IFTHEN is actually a DFSORT function that can be used with DFSORT's ICETOOL. If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts JCL sort card for file creation condi... DFSORT/ICETOOL 4
No new posts Removing date values lines/records fr... SYNCSORT 2
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
Search our Forums:

Back to Top