Stop after 1st string search using ISRSUPC



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Stop after 1st string search using ISRSUPC

Postby shivanshu26shiv » Mon Jul 06, 2015 10:25 pm

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.
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Stop after 1st string search using ISRSUPC

 

Re: Stop after 1st string search using ISRSUPC

Postby Mickeydusaor » Mon Jul 06, 2015 10:30 pm

remove the quotes in your PARM
User avatar
Mickeydusaor
 
Posts: 29
Joined: Fri Feb 24, 2012 11:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Stop after 1st string search using ISRSUPC

Postby shivanshu26shiv » Mon Jul 06, 2015 10:32 pm

Mickeydusaor wrote:remove the quotes in your PARM


Thanks for reply but not working :(
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Stop after 1st string search using ISRSUPC

Postby Pedro » Tue Jul 07, 2015 1:47 am

Part of your post does not make sense to me. Are you comparing the files or searching for text?
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: Stop after 1st string search using ISRSUPC

Postby shivanshu26shiv » Tue Jul 07, 2015 4:34 am

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 %.
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Stop after 1st string search using ISRSUPC

Postby NicC » Tue Jul 07, 2015 5:00 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Stop after 1st string search using ISRSUPC

Postby enrico-sorichetti » Tue Jul 07, 2015 6:57 pm

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 ==> ...
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Stop after 1st string search using ISRSUPC

Postby shivanshu26shiv » Tue Jul 07, 2015 7:16 pm

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 ...
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Stop after 1st string search using ISRSUPC

Postby enrico-sorichetti » Tue Jul 07, 2015 7:42 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Stop after 1st string search using ISRSUPC

Postby shivanshu26shiv » Tue Jul 07, 2015 8:09 pm

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 :) ,
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Next

Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post