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
 

 

Removing duplicates conditionally

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

Moderator


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

PostPosted: Wed Aug 29, 2007 4:24 pm    Post subject: Removing duplicates conditionally
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    Post subject:
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: 2180
Location: @my desk

PostPosted: Wed Aug 29, 2007 6:06 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2180
Location: @my desk

PostPosted: Wed Aug 29, 2007 6:59 pm    Post subject:
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: 2180
Location: @my desk

PostPosted: Wed Aug 29, 2007 7:07 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 31, 2007 4:08 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts To split the record conditionally Lakshmi Prakash DFSORT/ICETOOL 4 Mon Feb 22, 2016 7:52 pm
No new posts Removing the MODETAB field in a VTAM ... rcwing All Other Mainframe Topics 1 Fri Feb 19, 2016 7:11 pm


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