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
 

 

Search presence of more than one string in same PDS member

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Search presence of more than one string in same PDS member
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: 1703
Location: Australia

PostPosted: Wed Mar 03, 2010 10:27 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Mar 03, 2010 11:06 am    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Mar 03, 2010 12:55 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Mar 03, 2010 1:33 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Mar 03, 2010 1:45 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Mar 03, 2010 2:34 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Mar 03, 2010 4:24 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Mar 04, 2010 3:35 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Mar 04, 2010 4:28 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Mar 04, 2010 4:34 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm


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