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 

Eliminate group of records based on criteria

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


Joined: 27 May 2003
Posts: 22
Topics: 2
Location: India

PostPosted: Mon Nov 02, 2009 10:51 am    Post subject: Eliminate group of records based on criteria Reply with quote

Hi,

My requirement is as follows.

Input FB 80 (1 to 6 is key). based on position 7 I need to eliminate group of similar records. If I get key value followed by only '2' then I need to eliminate those records. Duplicates are allowed. I want the order same as they appear in the input.

example:
AAAAAA1
AAAAAA1
AAAAAA1
AAAAAA2
AAAAAA2
BBBBBB2
BBBBBB2
CCCCC1
CCCCC1
CCCCC2
CCCCC3

Expected output is
AAAAAA1
AAAAAA1
AAAAAA1
AAAAAA2
AAAAAA2
CCCCC1
CCCCC1
CCCCC2
CCCCC3

I checked other topics using IFTHEN and GROUP. Can somebody help me how to do this ?

Thanks
_________________
Thanks
-Ram
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Nov 02, 2009 11:38 am    Post subject: Reply with quote

rk_pulikonda,

Try this JCL.


Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                       
AAAAAA1                                                               
AAAAAA1                                                               
AAAAAA1                                                               
AAAAAA2                                                               
AAAAAA2                                                               
BBBBBB2                                                               
BBBBBB2                                                               
CCCCCC1                                                               
CCCCCC1                                                               
CCCCCC2                                                               
CCCCCC3                                                               
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,6),7,1)),
  IFTHEN=(WHEN=GROUP,BEGIN=(81,8,ZD,EQ,1),PUSH=(90:7,1))             
  OUTFIL OMIT=(89,2,ZD,EQ,22),BUILD=(1,80)                           
/*

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


Joined: 27 May 2003
Posts: 22
Topics: 2
Location: India

PostPosted: Tue Nov 03, 2009 10:31 am    Post subject: Reply with quote

Kolusu as always thanks for the quick reply.

I am getting the syntax error. Here is my sysout.

INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,6),89:7,1)),
IFTHEN=(WHEN=GROUP,BEGIN=(81,8,ZD,EQ,1),PUSH=(90:7,1))
*
SORT FIELDS=COPY
OUTFIL OMIT=(89,2,ZD,EQ,22),BUILD=(1,80)
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
_________________
Thanks
-Ram
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Nov 03, 2009 11:43 am    Post subject: Reply with quote

Kolusu's job works fine with DFSORT. But the WER messages indicate you're using Syncsort, not DFSORT.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Tue Nov 03, 2009 3:01 pm    Post subject: Reply with quote

rk_pulikonda:

The WER268A syntax error message indicates that you are using an older level of SyncSort for z/OS that does not include support for WHEN=GROUP. Support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2 (Release 1.3, TPF2 maintenance level), which has been available since January 2009. This is a free upgrade to licensed SyncSort customers.
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
rk_pulikonda
Beginner


Joined: 27 May 2003
Posts: 22
Topics: 2
Location: India

PostPosted: Wed Nov 04, 2009 2:28 am    Post subject: Reply with quote

Thank you Kolusu, Frank, Brain wood for the responses.

I really appreciate your time.

Thanks
_________________
Thanks
-Ram
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