Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

include records having string more than once

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
venkatesh83be

New User


Joined: 10 Aug 2009
Posts: 12
Location: Chennai

PostPosted: Wed Jul 21, 2010 8:37 am    Post subject:
Reply with quote

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
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jul 21, 2010 10:28 am    Post subject:
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jul 21, 2010 11:21 am    Post subject:
Reply with quote

Hi,

Oops icon_redface.gif I just realised my solution is for DFSORT and not SYNCSORT


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

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Jul 21, 2010 6:58 pm    Post subject: Reply to: include records having string more than once
Reply with quote

That solution will work with SyncSort for z/OS 1.3 as well.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us