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
 

 

How to find out the occurrence of a certain string in a col

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Satyajit

New User


Joined: 25 Jan 2006
Posts: 27

PostPosted: Fri Dec 01, 2006 3:20 pm    Post subject: To count the occurrence of a string.
Reply with quote

Hi Frank
Can u please tell me how to find out the occurrence of a certain string in a column? suppose the flat file contains

ASDKJDASKABCSAJKFLGSA
ASDKJDASKABCSAJKFLGSA
ASDKJDASKABCSAJKFLGSA
ASDKJDASKDEFSAJKFLGSA
ASDKJDASKDEFSAJKFLGSA
ASDKJDASKGGGSAJKFLGSA
ASDKJDASKGGGSAJKFLGSA
ASDKJDASKABCSAJKFLGSA
ASDKJDASKDEFSAJKFLGSA


my o/p should have
ABC 4
DEF 3
GGG2
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 01, 2006 10:17 pm    Post subject:
Reply with quote

You can use the OCCUR operator of DFSORT's ICETOOL to do that. For example:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//RPT DD DSN=...  output file
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) NOHEADER ON(10,3,CH) ON(VALCNT,E'99')
/*


For complete information on the OCCUR operator, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.9?DT=20060615185603
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1202
Location: India

PostPosted: Fri Dec 15, 2006 12:04 pm    Post subject:
Reply with quote

Back to top
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Fri Dec 15, 2006 1:18 pm    Post subject: Re: How to find out the occurrence of a certain string in a
Reply with quote

Hi
Below is SYNCSORT Solution.

Code:
//SYSIN     DD *                                         
 INREC   FIELDS=(1,21,C'000001')                         
 SORT    FIELDS=(1,21,CH,A)                             
 SUM     FIELDS=(22,6,ZD)                               
 OUTFIL  REMOVECC,                                       
          HEADER1=('COUNTS OF RECORDS'),                 
          OUTREC=(1:11,3,1X,22,6,ZD,EDIT=(III,IIT),80X) 
/*                                                       


Let me know if it is not clear.

Thanks,
Rajen Patel.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


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