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 

Count Number of Occurances of a String in a JCL

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


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Fri Oct 21, 2011 12:34 pm    Post subject: Count Number of Occurances of a String in a JCL Reply with quote

Hi,

I need to get the count of the number of occurances of the string 'COVER-PAGE-START' into an ouput file.
This string only occurs in column 14 of the FB, LRECL=112 input dataset.

Pls. let me know how this can be done in a JCL using any common utility.



Thanks,
vini
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: Fri Oct 21, 2011 12:42 pm    Post subject: Reply with quote

You can use a DFSORT job like the following:

Code:

//S1 EXEC PGM=SORT                                   
//SYSOUT DD SYSOUT=*                                 
//SORTIN DD DSN=...  input file                 
//SORTOUT DD DSN=...  output file                         
//SYSIN DD *                                         
  OPTION COPY                                         
  INCLUDE COND=(14,16,CH,EQ,C'COVER-PAGE START')     
  OUTFIL REMOVECC,NODETAIL,                           
    TRAILER1=(COUNT=(M11,LENGTH=8))                 
/*

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