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
 

 

Compare two files and remove duplicates
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Shivendu

New User


Joined: 20 Feb 2009
Posts: 14
Location: Workstation

PostPosted: Mon Apr 06, 2009 12:31 pm    Post subject: Compare two files and remove duplicates
Reply with quote

Need to compare data in two files FILE1 and FILE2. Data which is present ONLY in FILE2 should be written to a new file FILE3 (i.e removing
duplicates)

Both files have same format and rec length.
Need to do thru SORT only (or NATURAL) and not ICETOOL as its not available here.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 1:13 pm    Post subject: Re: Compare two files and remove duplicates
Reply with quote

Shivendu wrote:
and not ICETOOL as its not available here.
How did you conclude this? Which SORT product is installed at your shop? If Sync Sort what version of that?
Back to top
View user's profile Send private message
Shivendu

New User


Joined: 20 Feb 2009
Posts: 14
Location: Workstation

PostPosted: Mon Apr 06, 2009 1:32 pm    Post subject: Reply to: Compare two files and remove duplicates
Reply with quote

Coz I tried with ICETOOL and its not working.
It's a bit urgent.
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 1:34 pm    Post subject:
Reply with quote

Quote:
Coz I tried with ICETOOL and its not working


As anuj said could you let us know which sort product is installed in your shop with the version?
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 1:37 pm    Post subject:
Reply with quote

Quote:
and not ICETOOL as its not available here.



What is the pgm name you used for sort?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Apr 06, 2009 1:38 pm    Post subject: Reply to: Compare two files and remove duplicates
Reply with quote

just take a decision,
ICETOOL not available, or You made mistakes in using it

not working is just blaming somebody else for one' s errors

did You search the forums with , for exampe "sort duplicates"
I am sure that You will find many hints on how to proceed
and what info to post in order to get better help
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 1:52 pm    Post subject:
Reply with quote

This
Quote:
and not ICETOOL as its not available here.
and this
Quote:
Coz I tried with ICETOOL and its not working
are totally different wordings...in a crude sense...if something is not working is from "application programmer's" point of view and something is not available is to do with "system programmers"...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 1:57 pm    Post subject:
Reply with quote

Hi,

To start with, you can try this JCL:
Code:
//************************************************************** 
//*THIS JCL WILL GIVE THREE OUTPUTS: OUT12,OUT1 & OUT2           
//*OUT12: OUTPUT-FILE WITH COMMON RECORDS IN TWO INPUT-FILES.     
//*OUT1 : OUTPUT-FILE WITH RECORDS ONLY IN INPUT IN1 NOT IN IN2. 
//*OUT2 : OUTPUT-FILE WITH RECORDS ONLY IN INPUT IN2 NOT IN IN1. 
//* ONE NEED TO CHANGE THE KEY-LENGTH WHILE USING JCL.           
//*CHANGE KEY LENGTH IN 'ON(1,3,CH)'                             
//************************************************************** 
//*                                                               
//STEP001 EXEC PGM=ICETOOL/SYNCTOOL                                     
//TOOLMSG DD SYSOUT=*                                           
//DFSMSG  DD SYSOUT=*                                           
//IN1     DD *
111 $$$$$
111 $$$$$
222 AAAAA
333 FFFFF
444 GGGGG
555 CCCCC
666 $$$$$
777 AAAAA
888 FFFFF
999 GGGGG
999 GGGGG
999 GGGGG
999 GGGGG
/*
//IN2     DD *
111 BBBBB
333 DDDDD
444 FFFFF
555 HHHHH
//T1      DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),             
//           DISP=(MOD,PASS)                                   
//OUT12   DD DSN=XXXXXX.MATCHED.OUTPUT,DISP=(NEW,CATLG,DELETE)
//OUT1    DD DSN=XXXXXX.ONLY.IN.IN1.OUT,DISP=(NEW,CATLG,DELETE)
//OUT2    DD DSN=XXXXXX.ONLY.IN.IN2.OUT,DISP=(NEW,CATLG,DELETE)
//TOOLIN  DD *                                                 
  COPY FROM(IN1) TO(T1) USING(CTL1)                             
  COPY FROM(IN2) TO(T1) USING(CTL2)                             
  SPLICE FROM(T1) TO(OUT12) ON(1,3,CH) WITH(81,1) -             
  USING(CTL3) KEEPNODUPS                                       
/*                                                             
//CTL1CNTL DD *                                                 
  INREC OVERLAY=(80:C'11')                                     
/*                                                             
//CTL2CNTL DD *                                                 
  INREC OVERLAY=(80:C'22')                                     
/*                                                             
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=OUT12,INCLUDE=(80,2,CH,EQ,C'12'),BUILD=(1,80) 
  OUTFIL FNAMES=OUT1,INCLUDE=(80,2,CH,EQ,C'11'),BUILD=(1,80)   
  OUTFIL FNAMES=OUT2,INCLUDE=(80,2,CH,EQ,C'22'),BUILD=(1,80)   
/*                                                             


"eidted"
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 2:02 pm    Post subject:
Reply with quote

Hi Anuj,
Code:
STEP001 EXEC PGM=ICECTOOL/


Will this work?
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 2:05 pm    Post subject:
Reply with quote

Hi Shivendu,

If
Code:
PGM=ICETOOL
is not working you can trying using
Code:
 PGM=ICEMAN
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 2:28 pm    Post subject:
Reply with quote

Hi,

By this:
Code:
PGM=ICECTOOL/SYNCTOOL
I meant code either one of these based on the product he has on his shop . . . though on Synsort shops ICETOOL will invoke SYNTOOL.

If you dont keep that "/" in below code, this
himanshu7 wrote:
Code:
STEP001 EXEC PGM=ICECTOOL/
should work.
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 2:31 pm    Post subject:
Reply with quote

Quote:
I meant code either one of these based on the product he has on his shop .


But Syncsort has any PGM=ICECTOOL?

Or it should be PGM=ICETOOL?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 2:32 pm    Post subject:
Reply with quote

himanshu7 wrote:
If
Code:
PGM=ICETOOL
is not working you can trying using
Code:
 PGM=ICEMAN
I wish Frank is not looking in this thread . . . icon_neutral.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 2:39 pm    Post subject:
Reply with quote

himanshu7 wrote:
But Syncsort has any PGM=ICECTOOL?
Yeah spell check time for me, it should be ICETOOL - I wrote this code on the fly..so . . . icon_redface.gif
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 2:50 pm    Post subject:
Reply with quote

Quote:
I wish Frank is not looking in this thread . . .


Please clarify, is there anything wrong?

As in our shop we are using Syncsort whcih is giving RC 20 for ICETOOL but RC 0 for the same ICEMAN sorting.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 3:19 pm    Post subject:
Reply with quote

himanshu7 wrote:
As in our shop we are using Syncsort whcih is giving RC 20 for ICETOOL but RC 0 for the same ICEMAN sorting.
Did you really execute the job as posted? When you run it using ICEMAN it would expect DD names like SORTIN, SORTOUT and SYSIN and they are not there in the job in question. . . icon_confused.gif

Which version of Sync Sort you are using at your shop?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 3:22 pm    Post subject:
Reply with quote

Hi,

Check these DFSORT links for the explanation of DD statements..

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.iceg200/icecom.htm

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.icea100/ice1ca20295.htm

PGM=ICEMAN and PGM=SORT invoke the sort product at your site.

DFSORT's ICETOOL (aliased to SYNCTOOL - is Syncsort, Inc.'s version of the ICETOOL package) provides additional functions beyond those found in DFSORT. ICETOOL is shipped free with DFSORT (has been since 1991) -if you have DFSORT, you have ICETOOL.

You have Syncsort, not DFSORT, so you should be using Syncsort's books, not DFSORT's books, however, they can help you in this context at least (and more actually)...so I'e given the links . . .
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Mon Apr 06, 2009 3:27 pm    Post subject:
Reply with quote

Hi Anuj,

We are using Syncsort..
Code:
SYNCSORT FOR Z/OS  1.3.1.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 06, 2009 3:32 pm    Post subject:
Reply with quote

Then the job should work with ICETOOL or SYNCTOOL as posted . . .
Back to top
View user's profile Send private message
Shivendu

New User


Joined: 20 Feb 2009
Posts: 14
Location: Workstation

PostPosted: Mon Apr 06, 2009 4:38 pm    Post subject:
Reply with quote

Quick help needed...
Code:
//TOOLIN DD *                                           
COPY FROM(IN1) TO(T1) USING(CTL1)                       
COPY FROM(IN2) TO(T1) USING(CTL2)                       
SELECT FROM(T1) TO(OUT) ON(1,13,CH) NODUPS USING(CTL3)
/*                                                     
//CTL1CNTL DD *                                         
  INREC OVERLAY=(3519:C'1')                             
/*                                                     
//CTL2CNTL DD *                                         
  INREC OVERLAY=(3519:C'2')                             
/*                                                     
//CTL3CNTL DD *                                         
  OUTFIL FNAMES=OUT,INCLUDE=(3519,1,CH,EQ,C'2'),       
    BUILD=(1,3518)                                     
/*                                                     


IN1

Code:
1001789877AQ1   1
1001910140AQ1   1
1001910140AQ1   2


IN2
Code:
1001789794AQ1   1
1001789877AQ1   1
1001910140AQ1   1
1001910140AQ1   2


OUTPUT i m gettng is
Code:
1001789794AQ1   1


But I want
Code:
1001789794AQ1   1
1001910140AQ1   1
1001910140AQ1   2



[/code]
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 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
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


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