Page 1 of 2

Stop after 1st string search using ISRSUPC

PostPosted: Mon Jul 06, 2015 10:25 pm
by shivanshu26shiv
I needed a jcl to search 2 strings in a PDS and go for 2nd string if it has found the first occurrence of 1st string,
and after finding 1st occurrence of 2nd string It should simply stop, then display the string for which it didn't found match, hence I used ISRSUPC for first half, but it is not stopping after 1st match instead its searching all mems for both strings, hence please tell where I am wrong...

//SEARCH  EXEC PGM=ISRSUPC,                 
//            PARM=(SRCHCMP,'FMSTOP,NOSUMS')         
//NEWDD  DD DSN=MY.PDS.NAME,DISP=SHR 
//OUTDD  DD SYSOUT=*                       
//SYSIN  DD *                               
SRCHFOR  'ABC'                           
SRCHFOR  'DEF'                             
/*           


Manual:
FMSTOP Immediately a difference is found between files, stops the compare with a return code of 1. This option provides a quicker way of telling if two files are different.

Re: Stop after 1st string search using ISRSUPC

PostPosted: Mon Jul 06, 2015 10:30 pm
by Mickeydusaor
remove the quotes in your PARM

Re: Stop after 1st string search using ISRSUPC

PostPosted: Mon Jul 06, 2015 10:32 pm
by shivanshu26shiv
Mickeydusaor wrote:remove the quotes in your PARM


Thanks for reply but not working :(

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 1:47 am
by Pedro
Part of your post does not make sense to me. Are you comparing the files or searching for text?

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 4:34 am
by shivanshu26shiv
I am searching for 2 strings in all mems of a PDS, for eg. If only string 2 is not found then output of the job shud be 'string 2'. Given JCL in my quest. is supposed to search string in shortest CPU %.

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 5:00 pm
by NicC
It is not JCL that you want but control cards (which are not JCL) or code. You may well have toi write your own code for such a requirement - rexx, ispexec and library services are probaly what you need.

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 6:57 pm
by enrico-sorichetti
the description of the requirement is clear as mud !

let' s forget about the resource consumption
and let' try to get the logic of the shebang ...

fill the dots for what You want to do

<string1>     found  and <string2>     found ==> ...
<string1>     found  and <string2> not found ==> ...

<string1> not found  and <string2>     found ==> ...
<string1> not found  and <string2> not found ==> ...

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 7:16 pm
by shivanshu26shiv
Ok :) pls let me re-phrase the logic of this shebang,

1st need,

Using ISRSUPC can I find whether a string exists in any mem of a PDS in first match i.e.; if that string is found in any mem, then jcl will stop looking it
in other mems ?

2nd need I will try again by myself,
which was, after implementing 1st need, If i search for 2 or > 2 strings then job should display only the string which are not found.

I know it could be easily done in REXX/easytrieve but here the given tool is ISRSUPC ...

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 7:42 pm
by enrico-sorichetti
we are just wasting time here ...

why do You care if ISRSUPC will stop or not ?

why not find out Yourself by running a simple job twice
once with FMSTOP and th other without

what are You going to do if it does not stop ?




I know it could be easily done in REXX
:D :D :D

Re: Stop after 1st string search using ISRSUPC

PostPosted: Tue Jul 07, 2015 8:09 pm
by shivanshu26shiv
Dear enrico-sorichetti , after running the job only (both with and without) I came to know that only FMSTOP is not enough
for getting desired results, and caring about stopping of ISRSUPC after getting first match is just a PLAIN AND SIMPLE REQUIREMENT .

Thanks anyways for your time :) ,