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

Search presence of more than one string in same PDS member


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Wed Mar 03, 2010 10:14 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 03, 2010 10:27 am
Reply with quote

Hi,


After "specify additional search strings" add a C after the second string

ie 'ALLOW' C

Gerry
Back to top
View user's profile Send private message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Wed Mar 03, 2010 10:47 am
Reply with quote

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
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Wed Mar 03, 2010 10:54 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 03, 2010 11:06 am
Reply with quote

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
View user's profile Send private message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Wed Mar 03, 2010 12:43 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Mar 03, 2010 12:55 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 03, 2010 1:33 pm
Reply with quote

Hi,

maybe I'm missing something,

Are both strings on the same line ?


Gerry
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Mar 03, 2010 1:45 pm
Reply with quote

Sorry sunil kumar purohit

I was interrupted editing my comment, so i created an almost
duplicate post.
Back to top
View user's profile Send private message
sunil kumar purohit

New User


Joined: 10 Sep 2009
Posts: 37
Location: bangalore

PostPosted: Wed Mar 03, 2010 2:12 pm
Reply with quote

It's ok Peter...

Hi km_abdullah,

Do you get the solution now?
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Wed Mar 03, 2010 2:29 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 03, 2010 2:34 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 03, 2010 4:24 pm
Reply with quote

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
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Thu Mar 04, 2010 3:06 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Mar 04, 2010 3:35 pm
Reply with quote

Try the following parm :

PARM=(SRCHCMP,'ANYC,FINDALL,XREF,NOPRTCC,NOSUMS')
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Thu Mar 04, 2010 4:12 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 04, 2010 4:28 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Mar 04, 2010 4:34 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top