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

Eliminating duplicates from files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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: 2146
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 7:50 pm
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: 496
Location: USA

PostPosted: Fri Apr 18, 2008 9:50 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Apr 25, 2008 7:14 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Apr 25, 2008 9:28 pm
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

Moderator Emeritus


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

PostPosted: Fri Apr 25, 2008 10:25 pm
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: 496
Location: USA

PostPosted: Fri Apr 25, 2008 10:32 pm
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
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: 2146
Location: At my coffee table

PostPosted: Sun Apr 27, 2008 11:35 pm
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

Moderator Emeritus


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

PostPosted: Mon Apr 28, 2008 2:52 am
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
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: 496
Location: USA

PostPosted: Mon Apr 28, 2008 8:12 pm
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: 496
Location: USA

PostPosted: Mon Apr 28, 2008 8:14 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files and write Matched/Unm... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top