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
 

 

Eliminating duplicates from files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
mvmadhavi

New User


Joined: 09 Nov 2006
Posts: 21

PostPosted: Fri Apr 18, 2008 2:55 pm    Post subject: Eliminating duplicates from files
Reply with quote

Hi,

I have two files

file 1 has 10 records
file2 has 3 records which are in file1
i need to eliminate those 3 records from file 1 and remaining 7 records
should be written to a new output file is there a synsort steps for these...


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

ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Apr 18, 2008 3:25 pm    Post subject:
Reply with quote

Assuming you do not have duplicates in your first file of 10 records, here is a job for your requirement.

Code:

//S1      EXEC PGM=SYNCTOOL   
//TOOLMSG DD SYSOUT=*         
//DFSMSG  DD SYSOUT=*         
//*                           
//IN1     DD *               
RECORD 01                     
RECORD 02                     
RECORD 03                     
RECORD 04                     
RECORD 05                     
RECORD 06                     
RECORD 07                     
RECORD 08                     
RECORD 09                     
RECORD 10                     
/*                           
//IN2     DD *                                               
RECORD 01                                                     
RECORD 05                                                     
RECORD 09                                                     
/*                                                           
//OUT DD DSN=OUTPUT-FILE-NAME,                               
//      DSORG=PS,RECFM=FB,DISP=(NEW,CATLG,DELETE)             
//TEMP1   DD DSN=&&TEMP1,                                     
//           SPACE=(CYL,(10,20),RLSE),DISP=(MOD,KEEP,DELETE) 
//TEMP2   DD DSN=&&TEMP2,                                     
//           SPACE=(CYL,(10,20),RLSE),DISP=(MOD,KEEP,DELETE) 
//TOOLIN  DD *                                                   
    COPY FROM(IN1) TO(TEMP1) USING(SRT1)                         
    COPY FROM(IN2) TO(TEMP1) USING(SRT2)                         
    SPLICE FROM(TEMP1) TO(TEMP2) ON(3,80,CH) WITH(2,1) KEEPNODUPS
    COPY FROM(TEMP2) TO(OUT) USING(SRT3)                         
/*                                                               
//SRT1CNTL DD *                                                   
    OPTION COPY                                                   
    OUTREC FIELDS=(C'AA',1,80)                                   
/*                                                               
//SRT2CNTL DD *                                                   
    OPTION COPY                                                   
    OUTREC FIELDS=(C'BB',1,80)                                   
/*                                                               
//SRT3CNTL DD *                     
    INCLUDE COND=(1,2,CH,EQ,C'AA') 
    OUTREC FIELDS=(3,80)           
/*                                 


Output:
Code:

RECORD 02
RECORD 03
RECORD 04
RECORD 06
RECORD 07
RECORD 08
RECORD 10


--Parag
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 7:50 pm    Post subject: Re: Eliminating duplicates from files
Reply with quote

mvmadhavi wrote:
i need to eliminate those 3 records from file 1 and remaining 7 records
should be written to a new output file is there a synsort steps for these...
I think Syncsort's JOIN should work, have you look at it?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Fri Apr 18, 2008 9:50 pm    Post subject:
Reply with quote

Madhavi,

CICS Guy is right. This can be accomplished in a single pass of the data using SyncSort's JOIN feature, which is supported in SyncSort for z/OS 1.2.0 and later. With Parag's sample data, you can code the following:
Code:
//STEP1 EXEC PGM=SYNCSORT
//SORTJNF1 DD *
RECORD 01                     
RECORD 02                     
RECORD 03                     
RECORD 04                     
RECORD 05                     
RECORD 06                     
RECORD 07                     
RECORD 08                     
RECORD 09                     
RECORD 10                     
//SORTJNF2 DD *
RECORD 01                     
RECORD 05                     
RECORD 09                     
//SORTOUT DD SYSOUT=*
//SYSOUT  DD SYSOUT=*
//SYSIN   DD *
   JOINKEYS FILES=F1,FIELDS=(1,9,A) 
   JOINKEYS FILES=F2,FIELDS=(1,9,A) 
   JOIN UNPAIRED,F1,ONLY               
   SORT FIELDS=COPY
/*
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Apr 25, 2008 12:23 pm    Post subject:
Reply with quote

Hi Alissa Margulies,
The PDF of sysncsort that I have does not contain any information about neither joinkeys nor splice. Could you please give me a Complete reference manual for sysncsort 1.5.3

--Parag
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 25, 2008 7:14 pm    Post subject:
Reply with quote

Hello Parag,

Please post the version information from an execution of Syncsort on your system. It will be at the top of the page.

The most current release of Syncsort (and very recently released at that) is 1.3 (not 1.5.n).
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Apr 25, 2008 8:18 pm    Post subject:
Reply with quote

Hi Dick,
Thanks for reply !!
Quote:

Please post the version information from an execution of Syncsort on your system. It will be at the top of the page.


SYT000I SYNCTOOL RELEASE 1.5.3 - COPYRIGHT 2004 SYNCSORT INC.

There is one more message.
SYNCSORT FOR Z/OS 1.2.3.1RI U.S. PATENTS: 4210961, 5117495
Hope I'm posting the right messages

--parag
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 25, 2008 9:28 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif

You are running the previous release of Syncsort (1.2). If i remember this right, SYNCTOOL was not documented in 1.2.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 25, 2008 10:25 pm    Post subject:
Reply with quote

Hello,

To add to the previous. . .

A SYNCTOOL manual is not available for 1.3. . .
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Fri Apr 25, 2008 10:32 pm    Post subject:
Reply with quote

ParagChouguley wrote:
The PDF of sysncsort that I have does not contain any information about neither joinkeys nor splice.

JOINKEYS is fully documented in the SyncSort for z/OS 1.2 Programmer's Guide. Which version of the manual are you looking at?
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Sun Apr 27, 2008 11:40 am    Post subject:
Reply with quote

Quote:

Which version of the manual are you looking at?


The best one to suit the product version I'm using.

--Parag
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Apr 27, 2008 11:35 pm    Post subject:
Reply with quote

ParagChouguley wrote:
The best one to suit the product version I'm using.
That did not answer the question........
If you can not find JOIN in the index, you are looking at a very old manual....
Contact Syncsort and get a current manual (and possibly a copy of "Exploiting SyncSort JOIN")
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 28, 2008 2:52 am    Post subject:
Reply with quote

Hello,

Quote:
The best one to suit the product version I'm using.
Well, IMHO, i think not. "The best one"(s) would include JOIN and JOINKEYS. I have both a 1.2 Programmers Guide an Exploiting JOIN publication that contain JOIN info. . .

If your system is licensed to use Syncsort, i am sure you can have them e-mailed to you. If you have an online support account, you can download them on your own (which is how i got mine).

Alissa - sorry if i went "overboard" icon_smile.gif
Back to top
View user's profile Send private message
veena_nagesh2002
Warnings : 1

Active User


Joined: 07 May 2005
Posts: 110
Location: hyderabad

PostPosted: Mon Apr 28, 2008 12:45 pm    Post subject:
Reply with quote

Hi Parag,

when i tried with your code, the out put is having all the 10 records
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Mon Apr 28, 2008 8:12 pm    Post subject:
Reply with quote

dick scherrer wrote:
Alissa - sorry if i went "overboard" icon_smile.gif

Not at all. I'm glad to have licensed customers informed about all the available support methods. Utilitizing the online support accounts makes my life a lot easier.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Mon Apr 28, 2008 8:14 pm    Post subject:
Reply with quote

(That should have been: "Utilizing the online support accounts makes my life a lot easier".)
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
Page 1 of 1

 

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