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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: list out all mems in a PDS which contain 2 specified strings
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

Moderator Team Head


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

PostPosted: Mon Jun 14, 2010 3:20 pm    Post subject: Re: list out all mems in a PDS which contain 2 specified str
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 14, 2010 4:08 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 14, 2010 7:38 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 14, 2010 8:17 pm    Post subject:
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    Post subject: Reply to: list out all mems in a PDS which contain 2 specifi
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

Site Director


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

PostPosted: Mon Jun 21, 2010 8:02 pm    Post subject:
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    Post subject: Reply to: list out all mems in a PDS which contain 2 specifi
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 22, 2010 2:58 pm    Post subject: Re: Reply to: list out all mems in a PDS which contain 2 spe
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: 1218
Location: Israel

PostPosted: Tue Jun 22, 2010 5:17 pm    Post subject: Reply to: list out all mems in a PDS which contain 2 specifi
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: 1218
Location: Israel

PostPosted: Tue Jun 22, 2010 5:26 pm    Post subject:
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    Post subject: Re: Reply to: list out all mems in a PDS which contain 2 spe
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts reorder screeNS using SWAP LIST? mrsidhu12 TSO/ISPF 5 Thu Sep 01, 2016 2:19 pm
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts how to find the duplicate list RAVIGUPTA1990 DB2 6 Wed Mar 30, 2016 12:11 am


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