IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

list out all mems in a PDS which contain 2 specified strings


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kotha Yadav

New User


Joined: 03 Jun 2010
Posts: 6
Location: Hyderabad

PostPosted: Mon Jun 14, 2010 3:17 pm
Reply with quote

Hi,
Can anyone suggest me how to list out all members in a PDS, which contains 2 specified strings.

Is it possible using SRCHFOR or 3.13 or 3.15.

If not suggest me the way i hav to proceed either using JCL or REXX.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 14, 2010 3:20 pm
Reply with quote

Kotha Yadav wrote:
Is it possible using SRCHFOR or 3.13 or 3.15.


Yes, that would probably be the easiest method to implement.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 4:08 pm
Reply with quote

Are we asking that each member must contain either or both strings ?
Back to top
View user's profile Send private message
Kotha Yadav

New User


Joined: 03 Jun 2010
Posts: 6
Location: Hyderabad

PostPosted: Mon Jun 14, 2010 7:32 pm
Reply with quote

The members which contain both the strings only should be displayed
Back to top
View user's profile Send private message
Kotha Yadav

New User


Joined: 03 Jun 2010
Posts: 6
Location: Hyderabad

PostPosted: Mon Jun 14, 2010 7:34 pm
Reply with quote

by using Srchfor, i can use as an OR condition, but i need something like an AND consition.
If it is possible using any means ,plz provide me with clear description.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 7:38 pm
Reply with quote

I believe that there is an option to specify that all search strings must be present in a member. Press PF1 whilst in 3.13 and read the online docu to see if it is possible. I am reasonably sure that it is
Back to top
View user's profile Send private message
Kotha Yadav

New User


Joined: 03 Jun 2010
Posts: 6
Location: Hyderabad

PostPosted: Mon Jun 14, 2010 8:04 pm
Reply with quote

i can find syntax for 2 strings present in the same line,
but my necessity is strings need not be present in the same line.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 8:17 pm
Reply with quote

Sorry about that, I remembered that there was an option for multiple search items to be found, just couldn't remember exactly what it was.

Search the PDS for all occurrences of string 1, then use the members found from that search to search for string 2.
Back to top
View user's profile Send private message
sai.bhagavatula

New User


Joined: 05 Mar 2007
Posts: 10
Location: Sydney, Australia

PostPosted: Mon Jun 21, 2010 12:37 pm
Reply with quote

You can get the previous and next lines apart from the lines containing string in SRCHFOR.

In 3.15, try using the process option LPSF as below. And, you can set the number of lines to appear using process statement LPSFV. But, incompleteness of this feature is that, it would display both pre-ceding and suc-ceding lines. Not just one.

Thought this might be helpful.

Code:

                         Extended Search-For Utility             Strings found
Command ===>                                                                 
                                                                             
Search DS Name  . . 'TEMP.LIBRARY'                                   
PDS Member List . . *           (blank/pattern - member list, * - search all)   
                                                                             
(Leave Search DSN "blank" for concatenated-uncataloged-password panel)       
                                                                             
Enter Search Strings and Optional operands (WORD/PREFIX/SUFFIX,C)             
   Caps . . THRU                                                             
   Caps . .                                                                   
   Caps . .                                                                   
   Asis . .                                                                   
   Asis . .                                                                   
                                                                             
Listing DSN . . . . SRCH.LIST                                                 
Process Options . . LPSF                                                     
Statements Dsn  . . SRCHFOR.STMTS                                             
                                                                             
Enter "/" to select option      Execution Mode          Output Mode           
/  Bypass selection list        1  1. Foreground        1  1. View           
                                   2. Batch                2. Browse         


In, SRCHFOR.STMTS

Code:

EDIT       XVPMES.SRCHFOR.STMTS                            Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
                                                                               
   Enter or change Process Statements in the EDIT window below:               
****** ***************************** Top of Data ******************************
000001 LPSFV 1                                                                 
****** **************************** Bottom of Data ****************************


If this doesnt help completely, then you have to choose REXX
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 21, 2010 8:02 pm
Reply with quote

Hello,

Quote:
then you have to choose REXX
Or simply do as Expat suggested. . .
Back to top
View user's profile Send private message
zhouqina

New User


Joined: 24 May 2007
Posts: 8
Location: china

PostPosted: Tue Jun 22, 2010 2:08 pm
Reply with quote

Hi,

You may use 3.14 batch utility to search the first string and then write a REXX to search the second string.

The JCL is supposed to have three steps:

1) Search the first string. <3.14 batch utility>
2) Extract the result member list from step 1. <3.14 batch utility>
3) Using the REXX program to search the second string. <REXX PGM>
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 22, 2010 2:58 pm
Reply with quote

zhouqina wrote:
1) Search the first string. <3.14 batch utility>
2) Extract the result member list from step 1. <3.14 batch utility>
3) Using the REXX program to search the second string. <REXX PGM>
Why use REXX for the second search ? Why write a REXX when SUPERC will do it for you.

/good mood on
Since I had some very similar code before - this performs the first search, reads the output to produce a list of members where search item 1 was found to act as a control when searching for item 2.

Basically, this will go through my REXX library and find all occurrences of where ISPEXEC has been used. The output is processed by the sort step which generates one SELECT membername card for each member where ISPEXEC was found, and this list is then fed into a second search so that only these members will be searched for the second search item.
Code:
//STEP0010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DELETE   UID.SEARCH.OUTPUT
  DELETE   UID.SEARCH.SECOND
  SET MAXCC EQ 0
/* 
//* 
//STEP0020 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC',IDPFX,XREF)
//NEWDD    DD DISP=SHR,DSN=UID.REXX
//OUTDD    DD DSN=UID.SEARCH.OUTPUT,DISP=(,CATLG,DELETE),
//            SPACE=(TRK,(45,45),RLSE)                     
//SYSIN    DD *                                             
  CMPCOLM   1:80                                           
  SRCHFOR   'ISPEXEC'                                       
/*                                                         
//*                                                         
//STEP0030 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=UID.SEARCH.OUTPUT,DISP=SHR                 
//SORTOUT  DD DSN=UID.SEARCH.SECOND,DISP=(,CATLG,DELETE),     
//            RECFM=FB,LRECL=80,SPACE=(TRK,(45,45),RLSE)     
//SYSIN    DD *                                             
  SORT     FIELDS=(2,8,CH,A)                                 
  SUM      FIELDS=NONE                                       
  INCLUDE  COND=(20,112,SS,EQ,C'ISPEXEC')                   
  OUTREC   BUILD=(C'  SELECT ',2,8,80:X)                     
/*                                                           
//*                                                         
//STEP0040 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC',IDPFX,XREF)
//NEWDD    DD DISP=SHR,DSN=UID.REXX                           
//OUTDD    DD SYSOUT=*                                       
//SYSIN    DD *                                             
  CMPCOLM   1:80                                             
  SRCHFOR   'PANEL('                                         
//         DD DSN=UID.SEARCH.SECOND,DISP=SHR


/good mood off
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 22, 2010 5:17 pm
Reply with quote

In batch, you have to code SRCHFOR and SRCHFORC:
Code:
SRCHFOR  'FILLER'
SRCHFORC 'PIC'   


In 3.14 panel, select first "Specify additional search strings" and on the panel use the "C" character:
Code:
                         Search-For Strings                       
Command ===>                                                     
                                                                 
                  Specify 1 or more Search Strings below:         
                                                                 
  ==> FILLER                                                     
  ==> PIC       C                                                       
  ==>                                                             
  ==>                                                             
                                                                 
           Press ENTER to start search or END command to exit.   
On this panel, PF1 says it all:
Quote:
You can use the C (continuation) operand to specify that both the
current and previous string must be found on the same line to constitute a
match. Otherwise lines with either string will be treated as matching.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 22, 2010 5:26 pm
Reply with quote

In addition, you can use the '+' character:
Code:
SRCHFOR  'FILLER'
SRCHFORC 'PIC',+
to tell the 2nd string have to be found on the right side of 1st string.
I don't know how to do this in foreground 3.14 option.
Back to top
View user's profile Send private message
zhouqina

New User


Joined: 24 May 2007
Posts: 8
Location: china

PostPosted: Wed Jun 23, 2010 8:43 am
Reply with quote

expat wrote:
zhouqina wrote:
1) Search the first string. <3.14 batch utility>
2) Extract the result member list from step 1. <3.14 batch utility>
3) Using the REXX program to search the second string. <REXX PGM>
Why use REXX for the second search ? Why write a REXX when SUPERC will do it for you.

/good mood on
Since I had some very similar code before - this performs the first search, reads the output to produce a list of members where search item 1 was found to act as a control when searching for item 2.

Basically, this will go through my REXX library and find all occurrences of where ISPEXEC has been used. The output is processed by the sort step which generates one SELECT membername card for each member where ISPEXEC was found, and this list is then fed into a second search so that only these members will be searched for the second search item.

/good mood off


Yes, your method would be better icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts list pds members name starting with xyz CLIST & REXX 11
No new posts List of quiesced jobs JCL & VSAM 3
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
Search our Forums:

Back to Top