View previous topic :: View next topic
|
Author |
Message |
venkatesh83be
New User
Joined: 10 Aug 2009 Posts: 12 Location: Chennai
|
|
|
|
Hi All,
Can anyone help me to fetch those records having the search string more than once....
For an instance, if i/p is as below and search string is "@53" -
Code: |
78945@5313213468..
12345@531215@53....
111@53111@53111..
|
o/p should contain only 2nd and 3rd record as "@53" occurs more than once in them.
Thanks,
Venkat. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is a way of achieving this
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
78945@5313213468..
12345@531215@53....
111@53111@53111
//GT1 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC PARSE=(%=(STARTAT=C'@53'),
%1=(STARTAT=C'@53',FIXLEN=3)),
OVERLAY=(81:%1)
OUTFIL FNAMES=GT1,INCLUDE=(81,1,CH,NE,C' '),BUILD=(1,80)
/*
|
Gerry |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
Oops I just realised my solution is for DFSORT and not SYNCSORT
Gerry |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
That solution will work with SyncSort for z/OS 1.3 as well. |
|
Back to top |
|
|
|