MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFSORT help to identify recs with same key and diff. data

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Wed May 11, 2011 7:46 pm    Post subject: DFSORT help to identify recs with same key and diff. data Reply with quote

Hi,
I need a help with DFSORT

Input ( Key & Data)
-------
Code:

K1   D1
K1   D2
K1   D3
K1   D1
K2   D1
K3   D1
K3   D1
K4   D1
K4   D2

Output
--------
Code:

K1   D1
K1   D2
K1   D3
K4   D1
K4   D2

I want all the records with the same key occurring more than once and with different data values.

Thank you,

Vijay
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 12, 2011 11:04 am    Post subject: Reply with quote

vijay,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
----+----1----+----2----+----3----+----4----+----5----+----6----
K1   D1                                                         
K1   D2                                                         
K1   D3                                                         
K1   D1                                                         
K2   D1                                                         
K3   D1                                                         
K3   D1                                                         
K4   D1                                                         
K4   D2                                                         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,2),PUSH=(81:1,80,SEQ=3))

  OUTFIL REMOVECC,BUILD=(1,80),SECTIONS=(1,2,HEADER3=(81,80)), 
  INCLUDE=(161,3,ZD,GT,1,AND,(6,2,CH,NE,86,2,CH))               
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Thu May 12, 2011 12:55 pm    Post subject: Reply with quote

Thank you Kolusu.It works
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group