Search for text in data sets

With ZOAU, you can search the PDSE members of ${prefix}.MY.GREP for the case-sensitive string 'line' with any of the following ways:

  • Issuing a shell command:

    • Option 1:
    dgrep "line" "${prefix}.my.grep"
    
    • Option 2:
    args='SRCHCMP,IDPRFX,NOSUMS,LONGLN,NOPRTCC'
    mvscmd --pgm=ISRSUPC --args="${args}" --sysprint=* --outdd=* --newdd="${prefix}.my.grep(filetwo)" --sysin=stdin <<zz
      SRCHFOR 'line'
    zz
    
  • Calling an API in Python programs:

    datasets.search("%s.my.grep" % HLQ, value="line")
    

Without ZOAU, to achieve the same purpose, you need to write the following JCL statements:

//*
//* Search the dataset member @@HLQ@@.ZOASAMP.MY.GREP(FILETWO)
//* for the (case insensitive) string 'line'
//* printing results to OUTDD
//*
//DGREP EXEC PGM=ISRSUPC,                                             +
//      PARM='SRCHCMP,IDPRFX,NOSUMS,LONGLN,NOPRTCC'
//SYSIN DD *
  SRCHFOR 'line'
/*
//SYSPRINT DD SYSOUT=* 
//NEWDD  DD DSN=@@HLQ@@.ZOASAMP.MY.GREP(FILETWO),DISP=SHR
//OUTDD  DD SYSOUT=*