View previous topic :: View next topic
|
Author |
Message |
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
Hi,
Using 3.14 or 3.15 is it possible to search for presence of more than one string in same PDS member?
I want to search for presence of strings 'ATTACH' AND 'ALLOW'. I want members that contain both these strings.
If "Specify additional search strings" option is selected, the result is even if one of the search string is present, the member is selected.
Is there a way out? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
After "specify additional search strings" add a C after the second string
ie 'ALLOW' C
Gerry |
|
Back to top |
|
|
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
Hi,
This is possible. You can use option 3.14 and can give more than one string. When you submit for searching, you will get JCL for SRCHFOR.
Try that jcl to search members in pds based on string passed. |
|
Back to top |
|
|
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
Hi,
In 3.14, I tried like below -
Code: |
Command ===>
Specify 1 or more Search Strings below:
==> 'ATTACH'
==> 'ALLOW' C |
But it says 'No strings found'.
I am pretty sure that i have members that is having both these strings.
Am i going wrong anywhere? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am pretty sure that i have members that is having both these strings. |
Is there some reason you did not look at a few members and make sure you ran a test better than "pretty sure"?
You could even add a member that has both values. . . |
|
Back to top |
|
|
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
Hi,
Try this JCL
Code: |
//STEP0010 EXEC PGM=IEFBR14
//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,'ANYC',IDPFX,XREF)
//NEWDD DD DSN=DGCVPG1.CMS1.SUNIL,
// DISP=SHR
//OUTDD DD DSN=DGCVPG1.CMS1.PARK1,DISP=SHR
//SYSIN DD *
SRCHFOR 'CHECK'
SRCHFOR 'REPORT'
SRCHFOR 'LABEL' |
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Code: |
//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'IDPFX')
//NEWDD DD DSN=input pds,DISP=SHR
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'string1'
SRCHFOR 'string2'
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
maybe I'm missing something,
Are both strings on the same line ?
Gerry |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Sorry sunil kumar purohit
I was interrupted editing my comment, so i created an almost
duplicate post. |
|
Back to top |
|
|
sunil kumar purohit
New User
Joined: 10 Sep 2009 Posts: 37 Location: bangalore
|
|
|
|
It's ok Peter...
Hi km_abdullah,
Do you get the solution now? |
|
Back to top |
|
|
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
Hi Gerry,
The strings are in different line. Thanks for suggesting.
Hi Peter,
Your code fetched me exactly the result i am looking for. Thanks a ton.
Hi Sunil Kumar,
I think 'ANYC' parameter corresponds to 'OR' condition and hence it didn't work for me. Anyways thanks for your help. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
if both strings are required than the above solutions will not produce the required result.
A member will be listed as long as there is at least 1 match.
Gerry |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Sunil - I'm not sure what "IEFBR14" step is doing in your JCL? It's just not needed for the original request...
Quote: |
I think 'ANYC' parameter corresponds to 'OR' condition and hence it didn't work for me. |
The ANYC keyword specifies an ANY Case search. And when you say, "didn't work for me" - what should we consider? |
|
Back to top |
|
|
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
Peter
The solution provided by you too still fetches members as long as any one search string is found!
Sorry, i misread my results yesterday.
Gerry - you were right. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Try the following parm :
PARM=(SRCHCMP,'ANYC,FINDALL,XREF,NOPRTCC,NOSUMS') |
|
Back to top |
|
|
km_abdullah
New User
Joined: 03 Nov 2008 Posts: 60
|
|
|
|
Peter - the output is still the same.
I searched for 'PROJ' and 'FILE'. Sample output
Code: |
----- STRING="PROJ" IN I35AFESS
430 WHERE PROJET = :WXMO
431 AND SPROJET = :WES$$;
434 WHERE PROJET = :WXMO
435 AND SPROJET = :WES$$;
...
...
IN I35AFLAN
132 DCL 1 WPROJET CHAR(03);
133 DCL 1 WSPROJET CHAR(04);
...
...
----- STRING="FILE" IN I35AFESS
122 DCL FCORE FILE RECORD ;
1764 READ FILE(FCORE);
...
...
IN VALBONS
32 DCL FCORE FILE RECORD ;
36 DCL FICSEL FILE INPUT RECORD; |
The member VALBONS has only character FILE in it (no PROJ) but still it is displayed |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
one way to get the results you want is to massage the data produced by the search, this is one way to achieve this
Code: |
//STEP0001 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,IDPFX)
//NEWDD DD DSN=input-pds,
// DISP=SHR
//OUTDD DD DSN=output-file1,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(5,5),RLSE)
//SYSIN DD *
SRCHFOR 'string1'
SRCHFOR 'string2'
/*
//*********************************************************************
//STEP0002 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=OUTPUT-FILE1, FROM PREV STEP
// DISP=(OLD,PASS)
//SORTOUT DD DSN=OUTPUT-FILE2,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(5,5),RLSE)
//SYSIN DD *
SORT FIELDS=(2,8,CH,A,134,1,CH,A)
SUM FIELDS=NONE
INCLUDE COND=(17,1,FS,EQ,NUM)
INREC IFTHEN=(WHEN=(1,133,SS,EQ,C'STRING1'),
BUILD=(1,133,C'1')),
IFTHEN=(WHEN=(1,133,SS,EQ,C'STRING2'),
BUILD=(1,133,C'2'))
/*
//*********************************************************************
//*
//STEP0003 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=OUTPUT-FILE2,
// DISP=SHR
//OUT DD DSN=OUTPUT-FILE3,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(5,5),RLSE)
//OUTPUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(2,8,CH) HIGHER(1)
/*
//*********************************************************************
|
Gerry |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Hello km_abdullah,
im lost at the moment about the ISR utilility.
Beside what Gerry suggested, you could use Rexx for solving your problem. |
|
Back to top |
|
|
|