/* REXX */
/* You will need the TSO/ISPF book Manager clist files allocated */
/* set a PFKey to %BKSEARCH */
/* place the cursor on an abend code or message */
/* Press the appropriate PFKey */
trace err
parse arg msg junk
if length(msg) > 0 then do
shl = "shelf('the.dsn.of.your.messages.bkshelf ')"
args = "cmd(search "msg" )"
"ISPEXEC SELECT CMD(%EOXVSTRT" shl args ")",
"MODE(FSCR) SUSPEND NEWAPPL(EOXR) "
return
end
/* no parms passed */
Address ispexec
'VGET (ZSCREENI,ZSCREENC,ZENVIR)' /* Extract screen image,
cursor pos and ISPF level */
If substr(zenvir,5,4) <4.5 Then
Call get_zscreen_values
trtable='abcdefghijklmnopqrstuvwxyz' /* Setup valid msg chars */
trtable=trtable³³translate(trtable)³³'$#@0123456789.''-{()'
trtable=translate(xrange('00'x,'FF'x),,trtable,' ')
zscreeni=translate(zscreeni,,trtable,' ') /* Remove non-msg chars
*/
If substr(zscreeni,zscreenc+1,1) <> ' ' Then /* Maybe csr
on msg */
Do /* Extract msg from screen image
and call bookmgr */
msgid=word(substr(zscreeni,1+lastpos(' ',zscreeni,zscreenc)),1)
msgid=translate(strip(substr(msgid,1,56))) /* Max of 56 char
msgid */
shl = "shelf('the.dsn.of.your.messgaes.bkshelf')"
args = "cmd(search "msgid" )"
"ISPEXEC SELECT CMD(%EOXVSTRT" shl args ")",
"MODE(FSCR) SUSPEND NEWAPPL(EOXR) "
Exit 0
end
else do
say 'error error error'
exit 32
end
get_zscreen_values: /* obtain the screen image */
Address ispexec 'VGET (ZSCREENW,ZSCREEND)'
p = ptr(96+ptr(ptr(24+ptr(112+ptr(132+ptr(540))))))
zscreeni=translate(storage(d2x(p),,
zscreenw*zscreend),,xrange('00'x,'3f'x))
zscreenc = c2d(storage(,
d2x(164+ptr(ptr(24+ptr(112+ptr(132+ptr(540)))))),4))
Return
ptr: Return c2d(bitand(storage(d2x(Arg(1)),4),'7FFFFFFF'x))
Return