/* REXX SDSFXIT Used in conjunction with panel ISFPCU41 to do highlighting of SDSF data (log, job output, etc) Author: Doug Nadel (nadel@us.ibm.com) This code is as-is with no warranty of any kind */ Call isprexpx 'I' Signal on Novalue default_highlight_color = 'R' keywords.0=0 jclwords.0=0 targets.0 =0 keynums.0 =0 /* Specify keywords to highlight */ Call add 'COND CODE,14,Y' Call add 'CPU,20,W' Call add 'TYPE:,14,W' Call add 'Return Code,15,Y' Call add 'No Statements Flagged in this Assembly,,g' Call add 'Top of Data,,b' Call add 'BOTTOM OF DATA,,b' Call add 'JES2 JOB STATISTICS,,W' /* calls to 'addt' specify a string, and an optional color to be used to highlight from the start of the string to the end of the screen line in the specified color. */ Call addt 'IKT100,W' Call addt 'J E S 2 ,W' Call addt '** ASMA,R' Call addt ' //,G' Call addt ' //*,T' Call addt ' XX,Y' Call addt ' XX*,B' Call addt ' ++,Y' Call addt ' ++*,B' Call addt 'ICH70001I,W' /* last access */ Call addt 'IEFC653I,P' Call addt 'IEF212I,y' Call addt 'IEF272I,y' Call addt 'IEF450I,y' Call addt 'IEF472I,y' /* abend/completion code */ Call addt 'SYSTEM COMPLETION CODE,y' Call addt 'IEF125I,W' /* logon */ Call addt 'IEF126I,W' /* logoff */ Call addt 'ICH408I,R' /* racf failures */ Call addt 'IEC331I,R' /* severe catalog errors */ Call addt 'IEC332I,R' /* severe catalog errors */ Call addt 'IEC333I,R' /* severe catalog errors */ Call addt 'IEW2008I,Y' Call addt 'IEE600I,Y' /* reply to xx is; */ Call addt 'IGYDS,Y' /* calls to 'addn' specify a string, and an optional color to be used to highlight from the start of the string to the end of the screen line in the specifiied color. All numbers must be zero in the string to enable number data to be recognized for all numbers so that things like timestamps and jobids can be shown. */ Call addn '00.00.00 JOB00000 ,Y' Call addn 'NC0000000 ,w,56' Call addn 'SC ,w,56' Call addn '==000000==,Y' Call addn ' *00 ,Y' /* calls to 'addj' are JCL verbs to be highlighted in red if they are found after a // or XX. */ Call addj 'CNTL DLM EXEC JOB SET' Call addj 'COMMAND ELSE IF OUTPUT THEN' Call addj 'DATA ENDCNTL INCLUDE PEND XMIT' Call addj 'DD ENDIF JCLLIB PROC' /* -------------- end of customization ----------------------------- */ /* Make a copy of ISFBUF with only alphanumerics. This will be used as the reference string for finding keywords. Set up translate table of valid keyword characters */ trtable='ABCDEFGHIJKLMNOPQRSTUVWXYZ$#@0123456789_:*/' trtable=translate(xrange('00'x,'FF'x),,trtable,' ') isfbufcopy=translate(isfbuf) isfbufcopy=translate(isfbufcopy,,trtable,' ') /* Remove non-Kwd chars*/ /* Make a copy of ISFBUF with only dsname characters incl parens and quotes */ trtable='ABCDEFGHIJKLMNOPQRSTUVWXYZ$#@0123456789@$#_()''' trtable=translate(xrange('00'x,'FF'x),,trtable,' ') isfbufdsns=translate(isfbuf) isfbufdsns=translate(isfbufdsns,,trtable,' ') /* Remove non-Kwd chars*/ isfbufzero=translate(isfbuf,'0','123456789','0') shadow=copies(' ',length(shadow)) /* highlight asterisks in white */ Do a = 1 to length(isfbuf) If substr(isfbuf,a,1)='*' Then shadow=overlay('B',shadow,a,1,'B') End /* Look at the copy, finding keywords and update shadow accordingly highlight keys for key to end of line */ Do a = 1 to targets.0 target=targets.a wordlen=length(target) position=pos(target,isfbuf) Do While position>0 tlen=zscreenw - (position-1)//zscreenw tlen=length(strip(substr(isfbuf,position,tlen),'T')) shadow =overlay(tcolor.a,shadow,position,tlen,tcolor.a) position=pos(target,isfbuf,position+1) End End /* highlight to end of line for number keys */ Do a = 1 to keynums.0 keynum=keynums.a position=pos(keynum,isfbufzero) Do While position>0 position = position+nlen.a len=zscreenw - (position-1)//zscreenw len=length(strip(substr(isfbuf,position,len),'T')) shadow =overlay(ncolor.a,shadow,position,len,ncolor.a) position=pos(keynum,isfbufzero,position+1) End End /* highlight jcl verbs in // and XX lines */ rows = ((length(isfbuf)+zscreenw-1)%zscreenw )-1 Do a = 1 to jclwords.0 jclword=jclwords.a Do r = 0 to rows line = substr(isfbufcopy,zscreenw*r+1,zscreenw) position=pos(jclword,line) If position>0 Then Do p=pos('//',line) If p = 0 Then p=pos('XX',line) If p>0 & p '*' Then Do s=zscreenw*r+position shadow =overlay(jcolor.a,shadow,s,jlen.a,jcolor.a) position=pos(jclword,isfbufcopy,s+1) End End End End /* highlight real dsnames in JCL (dsn= only) */ jclword="DSN=" Do r = 0 to rows line = substr(isfbuf,zscreenw*r+1,zscreenw) position=pos(jclword,line) /* if position > 0 &, (substr(line, position + ln, 1) <> '&' |, substr(line, position + ln, 7) = '&SYSUID') then */ If position>0 & substr(line,position+4,1) <>'&' Then Do c=substr(line,position+4,1) Do p=position+4 to zscreenw Until c=' ' | c = ',' s=zscreenw*r+p shadow =overlay('W',shadow,s,1,'W') c=substr(line,p,1) End End End Do a = 1 to keywords.0 keyword=keywords.a wordlen=length(keyword) position=pos(keyword,isfbufcopy) Do While position>0 /* ISFBUFcopy=overlay(' ',ISFBUFcopy,position,wordlen) */ If position=1 Then Do If substr(isfbufcopy,position+wordlen,1)=' ' Then Do kcolor = kcolor.a klen=klen.a If klen='*' Then klen=zscreenw - (position-1)//zscreenw shadow =overlay(kcolor,shadow,position,klen,kcolor) End End Else If substr(isfbufcopy,position-1,1)=' ' Then If substr(isfbufcopy,position+wordlen,1)=' ' Then Do kcolor = kcolor.a klen=klen.a If klen='*' Then klen=zscreenw - (position-1)//zscreenw shadow =overlay(kcolor,shadow,position,klen,kcolor) End position=pos(keyword,isfbufcopy,position+1) End End Call isprexpx 'T' /* Send changes back to ispf */ return /*@ SDSFXIT */ /* . ----------------------------------------------------------------- */ add: /*@ */ If keywords.0=0 Then Do klen.='' kcolor.='' End a=keywords.0+1 keywords.0=a v=Arg(1) Parse Var v keywords.a ',' klen.a ',' kcolor.a keywords.a = translate(keywords.a) If klen.a='' Then klen.a=length(keywords.a) If kcolor.a = '' Then kcolor.a=default_highlight_color Return /*@ ADD */ /* . ----------------------------------------------------------------- */ addt: /*@ */ If targets.0=0 Then Do tlen.='' tcolor.='' End a=targets.0+1 targets.0=a v=Arg(1) Parse Var v targets.a ',' tcolor.a targets.a = translate(targets.a) If tlen.a='' Then tlen.a=length(targets.a) If tcolor.a = '' Then tcolor.a=default_highlight_color Return /*@ ADDT */ /* . ----------------------------------------------------------------- */ addn: /*@ */ If keynums.0=0 Then Do nlen.='' ncolor.='' End a=keynums.0+1 keynums.0=a v=Arg(1) Parse Var v keynums.a ',' ncolor.a ',' nlen.a keynums.a = translate(keynums.a) If nlen.a='' Then nlen.a=0 If ncolor.a = '' Then ncolor.a=default_highlight_color Return /*@ ADDN */ /* . ----------------------------------------------------------------- */ addj: /*@ */ If jclwords.0=0 Then Do jlen.='' jcolor.='R' End v=strip(space(Arg(1))) Do While v <> '' a=jclwords.0+1 jclwords.0=a Parse Var v jclwords.a v jclwords.a = ' 'jclwords.a' ' /* force blank wrapper */ jlen.a=length(jclwords.a) End Return /*@ ADDJ */