/* rexx */ /**********************************************************************/ /* Display text for error and reason codes */ /* */ /* PROPERTY OF IBM */ /* COPYRIGHT IBM CORP. 1995, 1997 */ /* */ /* Bill Schoen (SCHOEN at KGNVMC, schoen@vnet.ibm.com) 5/2/95 */ /**********************************************************************/ dsn="sys1.sbpxmenu" /* this is the library for the messages */ if datatype(__environment.0,w) then do i=1 to __environment.0 if substr(__environment.i,1,9)='ERRNODSN=' then dsn=substr(__environment.i,10) end address syscall arg ernos if ernos='' then do parse source . . . . who . say 'Usage:' who 'errorcode...' say 'Note: the errorcode must be a hex number and can be either' say ' an error number or the 8 digit reason code' return 2 end do while ernos<>'' parse var ernos erno ernos if length(erno)<4 then call locerrno erno else call locreason erno end return 0 locerrno: arg eno txts='(not found)' enoh=eno eno=right(x2d(eno),3,'0') msg='BPXW' || eno msgdsn=dsn"("substr(msg,1,6)")" xmsgs.0=0 call bpxwdyn "free fi(msg2)" if bpxwdyn("alloc fi(msg2) da("msgdsn") shr msg(2)")=0 then address mvs "execio * diskr msg2 (fini stem xmsgs." call bpxwdyn "free fi(msg2)" do i=1 to xmsgs.0 if word(xmsgs.i,1)=msg then do i=i+1 parse var xmsgs.i "'" txts ";" leave end end say right(enoh,8) txts return locreason: arg ejr ejr=right(ejr,8,0) id=substr(ejr,5,4) comp=x2d(substr(ejr,1,2)) select when x2d(id)>999 then msg='' when comp<32 then msg='BPXWR'right(x2d(id),3,'0') otherwise msg='' end xmsgs.0=0 txt='(not found)' rsndsn=dsn"("substr(msg,1,7)")" if msg<>'' then do call bpxwdyn "free fi(msg1)" if bpxwdyn("alloc fi(msg1) da("rsndsn") shr msg(2)")=0 then address mvs "execio * diskr msg1 (fini stem xmsgs." call bpxwdyn "free fi(msg1)" do i=1 to xmsgs.0 if word(xmsgs.i,1)=msg then do i=i+1 parse var xmsgs.i "'" txt "'" plus . if plus='+' then do i=i+1 parse var xmsgs.i "'" txtc "'" plus txt=txt || txtc end leave end end end say ejr txt return