I'm trying to use ADDRESS LINKMVS to call the Search-For Utility in Foreground mode. Please find below the code snippet:
ADDRESS TSO "ALLOC FI(OUTDD) DA('"<DSName1>"') SHR"
ADDRESS TSO "ALLOC FI(NEWDD) DA('"<DSName2>"') SHR"
ADDRESS TSO "ALLOC FI(SYSIN) DA('"<DSName3>"') SHR"
ADDRESS LINKMVS ISRSUPC SRCHCMP
ADDRESS TSO "FREE F(NEWDD)"
ADDRESS TSO "FREE F(SYSIN)"
ADDRESS TSO "FREE F(OUTDD)"
The above code works fine and returns the control back to my REXX routine. But for the searches which takes a longer time, e.g., NEWDD containing a lot of members to be searched (or) SYSIN dataset contains multiple search strings, I'm not getting the control back to my REXX routine and finally the Mainframe session gets automatically disconnected. I tried running the same in batch mode, and ended with S322 abend. Can someone suggest a solution to handle this scenario. I cannot go for batch mode, as it even consumes a lot of time for such searches. Can you please tell me if I'm missing something.