For purposes of this knowledge document, we will be searching for two strings found within the same PDS member. For example, we will look for 'IEBCOPY' and also 'PROD.LOADLIB' found within the same member and then write the found member into a new PDS. It is assumed obviously that this is a PDS containing JCL.
This will be accomplished using the FileMaster Plus batch job CAWABATC. It would be desirable to construct the control cards in such a way that this job can be done in one step.
It was found after research that this task requires as many job steps running CAWABATC as there are search strings. In the first step search for your first string, i.e., 'IEBCOPY', and copy those members into a new intermediate PDS. In the second step search for your second search string, i.e. 'PROD.LOADLIB' and copy those members into your second and final result PDS that contains both 'IEBCOPY' and 'PROD.LOADLIB'. You will need to pre-allocate the two JCL PDSs prior to running your multiple search strings CAWABATC batch job.
The JCL to accomplish this looks like this: