MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Search with AND
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Thu Sep 18, 2008 5:27 am    Post subject: Search with AND Reply with quote

Hi All,

I have a req that i have to search two strings with specified values in approx 500 modules.Manually its very tedious task.
Please let me know if this can be done by any tool or JCL.

Once again req is as follows:
This format is present in each module
but values of the string1....string5 might be different.

string1=1
string2=2
string3=3
string4=4
string5=5

I want only those modules where string1=1 and string5=5 are present.



Thanks in advance.
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Sep 18, 2008 8:02 am    Post subject: Use File-Aid batch. Reply with quote

You can use this File-Aid batch job to do this.......

Code:

//JS010    EXEC PGM=FILEAID                         
//DD01     DD DSN=YOUR.INPUT.FILE,
//            DISP=(SHR,KEEP,KEEP)                   
//SYSOUT   DD SYSOUT=*                               
//SYSUDUMP DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYSLIST  DD SYSOUT=*                               
//SYSTOTAL DD SYSOUT=*                               
//DD01O    DD SYSOUT=*                               
//SYSIN    DD *                                     
$$DD01 COPY IF=(1,0,C'STRING1'),AND=(1,0,C'STRING5')         
/*                                                   
//                                                   


Hope it helps.....
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Thu Sep 18, 2008 10:06 am    Post subject: Reply with quote

mrinalsolanki,

I assume you are searching for STRINGS=1 or STRINGS=5 in some library here.

Try this untested JCL,

Code:
//FASTEP   EXEC PGM=FILEAID,REGION=6M                                   
//SYSPRINT DD  SYSOUT=*                                                 
//SYSLIST  DD  SYSOUT=*                                                 
//DD01     DD  DSN=YOUR.INPUT.DSN,DISP=SHR
//DD01SC   DD  *
DEFINE BLOCKS=SELECTION,                                               
       INITIAL_SKIP=0,                                                 
       THEN_SELECT=1,                                                   
       THEN_SKIP=0,                                                     
       MAXIMUM_TO_SEARCH=ALL,                                           
       MAXIMUM_TO_SELECT=ALL                                           
SELECT SET=1                                                           
 IF                                                                     
       POSITION=1,LENGTH=80,OPERATOR=CO,                               
       TYPE=T,VALUE=STRING1=1                                             
SELECT SET=2                                                           
 IF                                                                     
       POSITION=1,LENGTH=80,OPERATOR=CO,                               
       TYPE=T,VALUE=STRING5=5
/*
//SYSIN    DD  *                                                       
$$DD01 PRINTMEM  EXPAND=Y,FORM=JCL                                     
/*                                                                     
//
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Sep 18, 2008 9:25 pm    Post subject: Reply with quote

You can also use 'LMTO XREF' option to list members for each string in 'Extended Search-For Utility' (3.15). Your screen would look like this -

Code:

   Menu  Utilities  Options  Help                                               
                                                                               
                          Extended Search-For Utility                           
  Command ===>                                                                   
                                                                    More:     +
  Search DS Name  . . 'my.dataset.name'                                         
 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 . . mrinal                                                             
    Caps . . dibakar                                                           
    Caps . .                                                                   
    Asis . .                                                                   
    Asis . .                                                                   
                                                                               
 Listing DSN . . . . SRCHFOR.LIST                                               
 Process Options . . LMTO XREF                                                 
 Statements Dsn  . .                                                           
                                                                               
 Enter "/" to select option      Execution Mode          Output Mode           
  /  Bypass selection list        1  1. Foreground        1  1. View             
Back to top
View user's profile Send private message Send e-mail
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Thu Sep 18, 2008 11:48 pm    Post subject: Reply with quote

Hi mf_user,

I got this error while running JCL .
Code:

CSV003I REQUESTED MODULE FILEAID  NOT FOUND
This error clearly explains that load for FILEAID is not present in any of the system library.

But i can use fileaid by U;FA option via ISPF.

Your thoughts?
Back to top
View user's profile Send private message
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Fri Sep 19, 2008 12:14 am    Post subject: Reply with quote

Hi Dibakar,

Is not there any option by that i found only those modules where a particular combination of string1=1 and string5=5 can be searched.Here is more elaboration

I have this format in a assembler macro:

Code:
ABC_DATA_TYPE=03
ABC_COL_NAME='XYZ       
ABC_LENGTH=0008,                       
ABC_SCALE=0002,                       
XYZ_DATA_TYPE=02,                 
XYZ_LENGTH=0008,                   
XYZ_SCALE=0002

ABC_DATA_TYPE=02
ABC_COL_NAME='XYZ       
ABC_LENGTH=0008,                       
ABC_SCALE=0002,                       
XYZ_DATA_TYPE=06,                 
XYZ_LENGTH=0008,                   
XYZ_SCALE=0002

ABC_DATA_TYPE=03
ABC_COL_NAME='XYZ       
ABC_LENGTH=0008,                       
ABC_SCALE=0002,                       
XYZ_DATA_TYPE=04,                 
XYZ_LENGTH=0008,                   
XYZ_SCALE=0002


Now I want all those modules where

ABC_DATA_TYPE=03 and XYZ_DATA_TYPE=02 must be together in one format.
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Sep 19, 2008 6:06 am    Post subject: Reply with quote

Quite simple in REXX using ISPF

1) Main REXX EXEC
Code:

 /* REXX *** LIST PDS AND INVOKE EDIT MACRO TO FIND CONDITIONS   */
                                                                       
 Address Ispexec "Control Errors Return"                               
 Pds = "pds name"
 mac = 'UPDATPD1'
 x = msg('off')
 x=outtrap(list.)
 "LISTDS '"Pds"' MEM "
 x=outtrap(off)
 Do aa = 7 to list.0
  "Ispexec edit dataset('"Pds!!"("!!Strip(list.aa)!!")') MACRO("mac")" 
 End                           



The Macro
Code:
 
/* REXX *** ISPF EDIT MACRO      */ 
Address Ispexec "Control Errors Return"
"ISREDIT MACRO"
"ISREDIT F 'string 1 = abc'  FIRST"
Rcx = RC
"ISREDIT F 'string 5 = xyz'  FIRST"
Rcy = RC                                 
If Rcx = 0 & Rcy = 0 then do             
  "ISREDIT (MEM) = MEMBER "
  SAY 'Criteria found in member name ' mem
End                                     

_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Fri Sep 19, 2008 6:23 am    Post subject: Reply with quote

Mrinal,

I would myself prefer rexx solution, or combination of rexx and somehigh level language, then I will never be limited by these utilities.

Alternately use solution given by Sqlcode, I am sure it will be quick. Loadlib for file-aid might be different at your place. Ask your colleagues. Only problem with File-Aid and Sort is that the syntax is not obvious so you have to ask lot of people. Secodly it is difficult for third person to understand.

Dibakar
Back to top
View user's profile Send private message Send e-mail
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Fri Sep 19, 2008 9:43 am    Post subject: Reply with quote

Mrinal,
You need include STEPLIB which will point to respective LOAD LIB in your system.

You may want to search in FILEAID.**.LOAD using 3.4.
Check libraries listed by above options and search. Asking your team mates is also a good option.

If this doesn't workout then go to
Code:
U --> FA --> 3 --> 6 (SEARCH/UPDATE) -->


Here Select B option to browse member. Specify your library name where u want to search for strings.

Select
Code:
Process Online or Batch Option to B --> Batch

THEN
Code:
Selection criteria usage ===> T


This should take u to next screen. Here select options as below.

Code:
Include record information    ===> Y
Process in JCL format         ===> Y
List entire member            ===> Y
Display member selection list ===> N


This should take u to File-Aid selection criteria screen. Select option 3
Give
Code:
1       80     CO T'.STRING5=5'
1       80     CO T'.STRING1=1'


Press PF3 twice and hit SUBMIT.

If you do everything fine, This should submit a jcl in your spool and you should see results in SYSLIST.

Let me know if it works or not.

Thanks,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Sep 19, 2008 2:45 pm    Post subject: Reply with quote

mrinalsolanki,

You can do this kind of thing more easily and efficiently with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this

Code:

//STEP0100 EXEC PGM=ICEMAN                                       
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
ABC_DATA_TYPE=03                                                 
ABC_COL_NAME='XYZ                                               
ABC_LENGTH=0008,                                                 
ABC_SCALE=0002,                                                 
XYZ_DATA_TYPE=02,                                               
XYZ_LENGTH=0008,                                                 
XYZ_SCALE=0002                                                   
ABC_DATA_TYPE=02                                                 
ABC_COL_NAME='XYZ                                               
ABC_LENGTH=0008,                                                 
ABC_SCALE=0002,                                                 
XYZ_DATA_TYPE=06,                                               
XYZ_LENGTH=0008,                                                 
XYZ_SCALE=0002                                                   
ABC_DATA_TYPE=03                                                 
ABC_COL_NAME='XYZ                                               
ABC_LENGTH=0008,                                                 
ABC_SCALE=0002,                                                 
XYZ_DATA_TYPE=04,                                               
XYZ_LENGTH=0008,                                                 
XYZ_SCALE=0002                                                   
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,16,CH,EQ,C'ABC_DATA_TYPE=03'),
  END=(1,14,CH,EQ,C'XYZ_SCALE=0002'),PUSH=(81:ID=1))             
                                                                 
  OUTFIL INCLUDE=(81,1,CH,GT,C' '),BUILD=(1,80)                   
/*


The output from the above job is

Code:

ABC_DATA_TYPE=03   
ABC_COL_NAME='XYZ   
ABC_LENGTH=0008,   
ABC_SCALE=0002,     
XYZ_DATA_TYPE=02,   
XYZ_LENGTH=0008,   
XYZ_SCALE=0002     
ABC_DATA_TYPE=03   
ABC_COL_NAME='XYZ   
ABC_LENGTH=0008,   
ABC_SCALE=0002,     
XYZ_DATA_TYPE=04,   
XYZ_LENGTH=0008,   
XYZ_SCALE=0002     


For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Sat Sep 20, 2008 10:59 am    Post subject: Reply with quote

Kolusu,

Mrinal doesn't want to extract data, his requirement is to get the names of all members in a PDS having two known strings.

Diba.
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sat Sep 20, 2008 9:04 pm    Post subject: batch DSN Reply with quote

Mrinal,

I've tried the below to find out STEPLIB used by File-Aid at out site.....

1). Go to File-Aid and choose option 3.3 (Copy).
2). Choose BATCH process

Code:

Specify Execution Information:                                   
  Process online or batch   ===> B        (O = Online; B = Batch)


3). Specify SELECTION CRITERIA by either 'Q' or 'T'
4). Edit the JCL given by File-Aid
5). Inside that you will find the STEPLIB (Commented out).

Code:

//*  YOU ARE VIEWING JCL THAT FILE-AID 8.9 HAS GENERATED TO           
//*  COPY DATASETS.                                                   
//*                                                                   
//*  YOU CAN CHANGE THIS JCL IF DESIRED AND USE THE SUBMIT PRIMARY   
//*  COMMAND TO SUBMIT THE JOB. THE CREATE OR REPLACE PRIMARY COMMAND
//*  CAN BE USED TO KEEP THIS JOBSTREAM FOR FUTURE USE.               
//*                                                                   
//*  USE THE END COMMAND TO EXIT WITHOUT SUBMITTING THE JOB.         
//*                                                                   
//*  COPYRIGHT (C) 2006 BY COMPUWARE CORPORATION, ALL RIGHTS RESERVED.
//*                                                                   
//FASTEP   EXEC PGM=FILEAID,REGION=6M                                 
//*STEPLIB DD  DISP=SHR,DSN=SYS2A.COMPUWAR.LINKLIB                   
//SYSPRINT DD  SYSOUT=*                                               


You can try the same at your site and let me know.....

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Wed Sep 24, 2008 12:20 am    Post subject: Reply with quote

Sqlcode,

By runnig JCL given by u, I got maxcc=8.Reason is as follows:

Code:
                                                       
DD01     DSN=MY.ABC.DS OPENED AS PO,             
             RECFM=FB,LRECL=80,BLKSIZE=6160,VOL=STGG01 
$$DD01 PRINTMEM  EXPAND=Y,FORM=JCL                     
BVE06-DD01SC MUST BE A PDS.                             
.....SKIPPING TO NEXT $$DD CARD


Reason is clear ,dataset provided in jcl is not PS but I just wanted to know how i would search in PO oriented datasets?
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Thu Sep 25, 2008 8:59 am    Post subject: Reply with quote

Mrinalsolanki,

Sorry for late reply.

Did you try other method which I have suggested using File Aid options.

If you try that method, It should automatically take care of PO issue.
Back to top
View user's profile Send private message
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Fri Sep 26, 2008 1:02 am    Post subject: Reply with quote

sqlcode,

I tried that but problem with that method is ,i didn't get desired results,
reason being that AND qualifier search both strings in a record but my problem is that both strings are in to different records.

is that any other parameter by which i combine 5 records into 1 and then do search
on that record set?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group