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 in sequential files

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

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 4:52 pm    Post subject: removing duplicates in sequential files
Reply with quote

Hi,

Can someone help me in the following requirement

I have two sequential files of length 133. The file has only values in the first 11 positions all other are spaces

The files looks like

file1..
A0000008060
A0000009980
A0000018060

file2...

A0000008060
A0000009980
A0000018060
A0000019980
A0000108060
A0000109980

The requirement is to delete the records in file2 if they are present in file1.

Now my output should be

A0000019980
A0000108060
A0000109980

Can some one could help me out...


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

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 18, 2007 4:59 pm    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

Use the SELECT operator and the NODUPS option of ICETOOL .
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 5:08 pm    Post subject:
Reply with quote

I tried the following code.

//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,1,CH,2,10,ZD) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(133:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(133:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),
BUILD=(1,132,1X)
/*


It gave me a syntax error in

OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),

Can you pls tell me what is the error in this...

Thanks,
Dharani
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Thu Oct 18, 2007 5:16 pm    Post subject:
Reply with quote

Did you used OUT as your dd name?
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 5:20 pm    Post subject:
Reply with quote

Yes Nuthan

IN1 & IN2 are DD names for input file1 and file2
OUT is the DD name for ouput file.

Thanks,
Dharani
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Oct 18, 2007 5:24 pm    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

Instead of BUILD=(1,132,1X), try OUTREC=(1,132,1X).
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 5:32 pm    Post subject:
Reply with quote

no luck for me superk.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 18, 2007 5:33 pm    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

nagarajan,

Use the below code

Code:

//S1    EXEC  PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//IN1 DD DSN=HLQ.ONE.ONX,DISP=SHR                               
//IN2 DD DSN=HLQ.TWO.TWX,DISP=SHR                               
//OUT  DD DSN=HLQ.T1T2TE,DISP=(,CATLG,DELETE)                   
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)       
//TOOLIN DD *                                                       
COPY FROM(IN1) TO(T1) USING(CTL1)                                   
COPY FROM(IN2) TO(T1) USING(CTL2)                                   
  SELECT FROM(T1) TO(OUT) ON(1,11,CH) NODUPS USING(CTL3)           
/*                                                                 
//CTL1CNTL DD *                                                     
  INREC OVERLAY=(133:C'1')                                         
/*                                                                 
//CTL2CNTL DD *                                                     
  INREC OVERLAY=(133:C'2')                                         
/*                                                                 
//CTL3CNTL DD *                                                     
  OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),                     
     BUILD=(1,132)                                                 
 /*


output:

Code:
A0000019980
A0000108060
A0000109980
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 18, 2007 5:36 pm    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

use the below control card for CTL3 to get an output with LRECL 133

Code:
 //CTL3CNTL DD *                                     
   OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),     
      BUILD=(1,132,133:X)                             
 /*                                                   
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 6:00 pm    Post subject:
Reply with quote

Thanks a lot Aaru.

It worked for my requirement


Thanks,
Dharani
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 18, 2007 6:04 pm    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

You are welcome icon_biggrin.gif
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 6:29 pm    Post subject:
Reply with quote

Hi Aaru,

Could you help me again with another one.

My requirement is the same to delete the records in file2 if they are present in file1. This should be done based on the emp-no.

First file has

A0000008060
A0000009980
A0000018060

Second one has

0000008060
0000009980
0000018060
0000019980
0000108060
0000109980

The emp-no is of 10 digits length. In first file it is from 2-11 positions
and in the second one it is from 1-10 positions.

Can this be done using icetool.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 18, 2007 6:48 pm    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

Nagarajan,

Use this sort card for your new requirement. Try and let me know if this works.

Code:

//TOOLIN DD *                                                           
COPY FROM(IN1) TO(T1) USING(CTL1)                                       
COPY FROM(IN2) TO(T1) USING(CTL2)                                       
  SELECT FROM(T1) TO(OUT) ON(2,10,CH) NODUPS USING(CTL3)               
/*                                                                     
//CTL1CNTL DD *                                                         
  INREC OVERLAY=(133:C'1')                                             
/*                                                                     
//CTL2CNTL DD *                                                         
  INREC OVERLAY=(2:1,10,132:X,133:C'2')                                 
/*                                                                     
//CTL3CNTL DD *                                                         
  OUTFIL FNAMES=OUT,INCLUDE=(133,1,CH,EQ,C'2'),                         
     BUILD=(1:2,10,133:X)                                               
/*                                                                     
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 7:44 pm    Post subject:
Reply with quote

Aaru, It worked fine for me.. Thanks again for your help
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Oct 19, 2007 8:19 am    Post subject: Reply to: removing duplicates in sequential files
Reply with quote

Glad that i was able to help you icon_biggrin.gif
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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