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

find matching entries from SORTOUT for entries from SORTXSUM


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Dec 12, 2013 4:33 pm
Reply with quote

Hi,

Can you please help me to find matching entries written to SORTOUT for all the duplicates written to SORTXSUM.

INPUT FILE - LRECL=30, RECFM=FB
Code:

----+----1----+----2----+----3
RECORD1 FROM FILE1 OF 20-10-13
RECORD1 FROM FILE1 OF 20-10-13
RECORD1 FROM FILE1 OF 20-10-13
RECORD6 FROM FILE8 OF 10-01-13
RECORD8 FROM FILE4 OF 16-06-13
RECORD8 FROM FILE4 OF 16-06-13
RECORD2 FROM FILE5 OF 08-09-13


SORTOUT:-
Code:

RECORD1 FROM FILE1 OF 20-10-13
RECORD8 FROM FILE4 OF 16-06-13
RECORD2 FROM FILE5 OF 08-09-13
RECORD6 FROM FILE8 OF 10-01-13


SORTXSUM:-
Code:

RECORD1 FROM FILE1 OF 20-10-13
RECORD1 FROM FILE1 OF 20-10-13
RECORD8 FROM FILE4 OF 16-06-13


Expected SORTOF1:- This should have matching entries from SORTOUT for match found from SORTXSUM
Code:

RECORD1 FROM FILE1 OF 20-10-13
RECORD8 FROM FILE4 OF 16-06-13


Expected SORTOF2:- This should have remaining entries from SORTOUT
Code:

RECORD2 FROM FILE5 OF 08-09-13
RECORD6 FROM FILE8 OF 10-01-13


My SORT job:-
Code:

//SORT01   EXEC PGM=SORT                   
//SORTIN   DD *                           
RECORD1 FROM FILE1 OF 20-10-13             
RECORD1 FROM FILE1 OF 20-10-13             
RECORD1 FROM FILE1 OF 20-10-13             
RECORD6 FROM FILE8 OF 10-01-13             
RECORD8 FROM FILE4 OF 16-06-13             
RECORD8 FROM FILE4 OF 16-06-13             
RECORD2 FROM FILE5 OF 08-09-13             
//SORTOUT  DD SYSOUT=*                     
//SORTXSUM DD SYSOUT=*                     
//SYSOUT   DD SYSOUT=*                     
//SYSIN    DD *                           
 SORT FIELDS=(1,6,CH,A,14,5,CH,A,23,8,CH,A)
 SUM FIELDS=NONE,XSUM                     


Please help.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Dec 12, 2013 4:50 pm
Reply with quote

What kind of requirement is this?

and what have you tried and what is stopping you?

and All you need is just another step with JOINKEYS to achieve the result needed

Edit: You might also eed unique data in SORTXSUM dataset
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Dec 13, 2013 3:31 am
Reply with quote

Hi,

try this

Code:
//STEP0001  EXEC PGM=ICETOOL                                     
//TOOLMSG   DD SYSOUT=*                                           
//DFSMSG    DD SYSOUT=*                                           
//IN        DD *                                                 
RECORD1 FROM FILE1 OF 20-10-13                                   
RECORD1 FROM FILE1 OF 20-10-13                                   
RECORD1 FROM FILE1 OF 20-10-13                                   
RECORD6 FROM FILE8 OF 10-01-13                                   
RECORD8 FROM FILE4 OF 16-06-13                                   
RECORD8 FROM FILE4 OF 16-06-13                                   
RECORD2 FROM FILE5 OF 08-09-13                                   
//T1        DD DSN=&&T1,DISP=(,PASS,DELETE),UNIT=SYSDA,           
//             SPACE=(TRK,(10,5),RLSE)                           
//OUT1      DD SYSOUT=*                                           
//OUT2      DD SYSOUT=*                                           
//TOOLIN    DD *                                                 
SELECT FROM(IN) TO(OUT1) ON(1,7,CH) ON(14,5,CH) ON(23,8,CH) -     
       NODUPS DISCARD(T1)                                         
SELECT FROM(T1) TO(OUT2) ON(1,7,CH) ON(14,5,CH) ON(23,8,CH) -     
       FIRSTDUP                                                   


Gerry
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sun Dec 15, 2013 11:07 am
Reply with quote

Pandora, thanks for the idea.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Sun Dec 15, 2013 11:12 am
Reply with quote

Ramsri,

You should look at Gicchet's post aswell
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Dec 15, 2013 9:41 pm
Reply with quote

Ramsri,

New avatar, but not much else changes.

Have you looked at using DUPKEYS instead of SUM, if your SyncSort has it?

If you don't have DUPKEYS, tell us what you want to achieve and show your existing step. Don't just ask us how to implement the method that you think should be used. Without DUPKEYS, it is likely that SyncTool will be a better shot at what you want, be we can't really tell.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Dec 16, 2013 9:21 am
Reply with quote

Haven't tried DUPKEYS......will try and post it here.

Thanks.
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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Rexx pattern matching on PS qualifer ... CLIST & REXX 1
No new posts SORT deletes the SORTOUT file DFSORT/ICETOOL 8
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
Search our Forums:

Back to Top