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 

How to get the search string along with result in ISRSUPC

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
astro
Beginner


Joined: 05 Oct 2005
Posts: 31
Topics: 7

PostPosted: Wed May 20, 2009 6:16 am    Post subject: How to get the search string along with result in ISRSUPC Reply with quote

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
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 21, 2009 3:31 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
astro
Beginner


Joined: 05 Oct 2005
Posts: 31
Topics: 7

PostPosted: Fri May 22, 2009 3:01 pm    Post subject: Reply with quote

Fantastic... Rolling Eyes
Thanks a lot kollusu...
Astro
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
Page 1 of 1

 
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