/* REXX *** */ /* locate string in BookManagerRead names */ PARSE UPPER ARG str /* the undocumented verbose option */ IF LEFT(str,2) = '/V' then DO str = STRIP(SUBSTR(str,3)) v = 1 END else v = 0 IF str = '' then DO SAY 'You must supply a search string' EXIT 4 END ADDRESS TSO '%EOXVOPTS' /* find the shelf of shelves */ ADDRESS ISPEXEC 'VGET (QLSHELF)' IF RC ^= 0 then DO SAY 'Unable to determine initial bookshelf' SAY 'This EXEC needs to run in a valid ISPF environment' EXIT 8 END 'ALLOC DA('qlshelf') FI(SHELFIN) REU SHR' IF RC ^= 0 then DO SAY 'Unable to allocate 'qlshelf' dataset' EXIT 8 END 'EXECIO * DISKR SHELFIN 1 (STEM shlf. FINIS)' m = 0 h = 0 DO i = 1 to shlf.0 /* for each bookshelf */ PARSE VAR shlf.i 'SHELF 'name dsn rest x = LISTDSI("'"dsn"'" 'NORECALL') IF x = 0 then DO "ALLOC DA('"dsn"') FI(SHELFIN) REU SHR" 'EXECIO * DISKR SHELFIN 10 (STEM bk. FINIS)' /* skip hdr */ /* read the bookshelf dataset */ DO j = 1 to bk.0 IF SUBSTR(bk.j,1,2) = 'ST' then DO scanv = STRIP(bk.j) UPPER scanv /* check the short book titles */ IF INDEX(scanv,str) ^= 0 then DO SAY name'=>'STRIP(SUBSTR(bk.j,3)) h = h + 1 END END END j END else if v then DO m = m + 1 txt.m = , STRIP(rest)' DSN='dsn m = m + 1 txt.m = , SUBSTR(sysmsglvl2,11) END END i IF h = 1 then th = ' hit ' else th = ' hits ' SAY h th'found' 'FREE FI(SHELFIN)' IF m > 0 then DO SAY '---------------------------------------------' SAY 'The following bookshelves were not processed:' DO i = 1 to m SAY txt.i END i SAY m' bookshelves were not processed' END EXIT 0