astro Beginner
Joined: 05 Oct 2005 Posts: 31 Topics: 7
|
Posted: Wed May 20, 2009 6:16 am Post subject: How to get the search string along with result in ISRSUPC |
|
|
Friends,
I am searching for more than one string by batch ISRSUPC pgm.
I know i can get the member name in each search result be specifying the PARM "IDPFX"
But I would also like to get the search string (mentioned in the SRCHFOR list) by which a line comes in the output..
For example,
If I am searching for a string "Happy" and it is availble in member "MEM1"
in a sentence "Girls are Happy"
We normally get the output as
MEM1 Line No Girls are happy
But I would like to get the result like:
MEM1 Happy Girls are happy
Can any help me out?
Thanks
Astro |
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu May 21, 2009 3:31 pm Post subject: |
|
|
astro,
use the parm XREF which tells you which string you searched. I assumed that you want to search a string of 20 bytes.
The following JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,IDPFX,XREF,NOSUMS)
//NEWDD DD DSN=YOUR PDS,
// DISP=SHR
//OUTDD DD DSN=&&O,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
SRCHFOR '20 byte string to be searched'
/*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&O,DISP=SHR
//SORTOUT DD SYSOUT=*,RECFM=FB
//SYSIN DD *
OMIT COND=(01,1,ZD,EQ,1,OR,03,15,CH,EQ,C'MEMBER LINE-#')
INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,14,CH,EQ,C'----- STRING="'),
PUSH=(134:15,20))
SORT FIELDS=COPY
OUTFIL BUILD=(134,20,2,132),
OMIT=(2,14,CH,EQ,C'----- STRING="',OR,1,133,CH,EQ,C' ')
/* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|