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 

Counting Strings in all members of a PDS using REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
kamineni.anil
Beginner


Joined: 09 May 2008
Posts: 2
Topics: 2

PostPosted: Sun Mar 22, 2009 5:29 am    Post subject: Counting Strings in all members of a PDS using REXX Reply with quote

hi,

I've 100 members in a PDS. Each member has 2 strings (say String1 and String2). I've to count the occurence of each string in the member and if both the strings string1 and string2 occur same number of times in a member then I can ignore that member otherwise If string1 and string2 occur different number of times in a member, then i've to write the member name in a file(or to ouput in spool is also fine). I've to repeat this for all 100 members in that PDS. Can any body suggest the simple way of doing this in either REXX or SORT or any other tool.

Thanks in advance.

Anil
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Mar 23, 2009 8:21 am    Post subject: Reply with quote

Sent a response via PM.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Mar 23, 2009 11:22 am    Post subject: Reply with quote

kamineni.anil,

A Batch version of 3.15 (Extended Search-For Utility) with IDPFX option and later use a sort step to count the occurrences of the strings involved. change the string1 and string2 to the strings you are searching/looking for

Code:

//STEP0100 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,IDPFX)                   
//NEWDD    DD DSN=Your pds to be searched,
//            DISP=SHR                                             
//OUTDD    DD DSN=&&O,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)           
//SYSIN    DD *                                                     
SRCHFOR  'string1'                                                 
SRCHFOR  'string2'                                                     
/*
//STEP0200 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=&&O,DISP=SHR                                     
//SORTOUT  DD SYSOUT=*,RECFM=FB                                     
//SYSIN    DD *                                                     
  OMIT COND=(01,10,CH,EQ,C'1  ISRSUPC',OR,                         
             02,05,CH,EQ,C' ',OR,                                   
             02,15,CH,EQ,C'PROCESS OPTIONS',OR,                     
             02,13,CH,EQ,C'THE FOLLOWING',OR,                       
             02,11,CH,EQ,C'LINES-FOUND',OR,                         
             03,15,CH,EQ,C'MEMBER   LINE-#',OR,                     
             05,07,CH,EQ,C'SRCHFOR',OR,                             
             07,26,CH,EQ,C'SEARCH-FOR SUMMARY SECTION')             
                                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:16C'0')),
  IFTHEN=(WHEN=(20,113,SS,EQ,C'string1'),     
  OVERLAY=(141:C'1'),HIT=NEXT),             
  IFTHEN=(WHEN=(20,113,SS,EQ,C'string2'),   
  OVERLAY=(149:C'1'))                                         
                                                                   
  SORT FIELDS=(2,8,CH,A)                                           
  SUM FIELDS=(134,8,142,8),FORMAT=ZD                               
                                                                   
  OUTREC OVERLAY=(134:134,8,ZD,M10,LENGTH=8,                       
                  142:142,8,ZD,M10,LENGTH=8)                       
                                                                   
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                             
  INCLUDE=(134,8,ZD,NE,142,8,ZD),                                   
  HEADER1=('MEMBER NAME',15:'STRING1 COUNT',30:'STRING2 COUNT',/,   
           '===========',15:'=============',30:'============='),   
  SECTIONS=(2,8,TRAILER3=(2,8,15:134,8,30:142,8))                   
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
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 -> TSO and ISPF 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