View previous topic :: View next topic
|
Author |
Message |
Kotha Yadav
New User
Joined: 03 Jun 2010 Posts: 6 Location: Hyderabad
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Are we asking that each member must contain either or both strings ? |
|
Back to top |
|
|
Kotha Yadav
New User
Joined: 03 Jun 2010 Posts: 6 Location: Hyderabad
|
|
|
|
The members which contain both the strings only should be displayed |
|
Back to top |
|
|
Kotha Yadav
New User
Joined: 03 Jun 2010 Posts: 6 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Kotha Yadav
New User
Joined: 03 Jun 2010 Posts: 6 Location: Hyderabad
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
sai.bhagavatula
New User
Joined: 05 Mar 2007 Posts: 10 Location: Sydney, Australia
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
then you have to choose REXX |
Or simply do as Expat suggested. . . |
|
Back to top |
|
|
zhouqina
New User
Joined: 24 May 2007 Posts: 8 Location: china
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
zhouqina
New User
Joined: 24 May 2007 Posts: 8 Location: china
|
|
|
|
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 |
|
Back to top |
|
|
|