Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Thu Oct 01, 2015 10:56 am Post subject:
misi01,
Here is the prolog of the exec along with source code written by Doug Nadel
Code:
/* Rexx - install panel exit in ISFPCU41 to do smart SDSF highlight */
/* */
/* instructions to create customized ISFPCU41 panel for SDSF and */
/* optional Rexx exec (external exec used on ISPF <5.6) */
/* */
/*1 copy this edit macro to a data set allocated to sysproc/sysexec. */
/*2 copy panel ISFPCU41 into a private panel library and edit it. */
/*3 invoke this as a macro */
/*4 IF INSTRUCTED TO DO SO, move the created exec to sysproc/sysexec.*/
/*5 invoke sdsf with the changed panel in ISPPLIB or by using */
/* LIBDEF to point to a PDS containing the changed panel. */
/* */
/* For older ISPF systems, Rexx exec mentioned in step 4 must also */
/* be available when SDSF is started or ISPF will crash!!! */
/* */
/* See the customization sections below to add customized hilight */
/* rules. It is best to change them here and regenerate the panel */
/* and optional clist because if SDSF changes, you can easily */
/* reapply the changes to the new SDSF panel. */
/* */
/*********************************************************************/
Address isredit
Signal on Novalue
'MACRO'
Address ispexec 'VGET (ZENVIR)'
ispf_is_old = substr(zenvir,6,3)<'5.6'
Call insert_attr
'F )INIT 1 FIRST'
Call insert_exec
'F )PROC 1 FIRST'
Call insert_proc
Call insert_comment
Call finalize
Return 1
/*$
/* REXX **************************************************************/
/* Name this Rexx exec 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 warrenty of any kind */
/*********************************************************************/
Call hello
Signal On Novalue
Call initialize
/* Specify keywords to highlight */
Call add "CPU,20,W" /* JES messages */
Call add "TYPE:,14,W" /* SCLM listing */
Call add "Return Code,15,Y" /* COBOL listing */
Call add "No Statements Flagged in this Assembly,,g" /* Asm listing */
Call add "Top of Data,,b" /* General */
Call add "BOTTOM OF DATA,,b" /* General */
Call add "JES2 JOB STATISTICS,,W" /* JES listing */
/* Calls to 'addp' specify strings that are to be highlighted after */
/* all other highlighting is complete. Use this to force highlights */
/* of specific strings in all cases. For exammple, any reference to */
/* the current user id.' Symantics are the same as for add: */
Call addp userid() || ",,Y" /* General highlighting of userid */
/* 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 specifiied color. */
Call addt "IKT100,W"
Call addt "J E S 2 ,W"
Call addt "** ASMA,R" /* Asm listing */
Call addt " //,G" /* Part of jcl coloring */
Call addt " //*,T" /* Part of jcl coloring */
Call addt " XX,Y" /* Part of jcl coloring */
Call addt " XX*,B" /* Part of jcl coloring */
Call addt "IEFC653I,P" /* Jcl substitution message */
Call addt "ICH70001I,W" /* Last access */
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. */
/* Highlight SCLM listings where first non blank is an asterisk */
/* Also highlight local jobs in da, St, O, H listings */
userid = userid()
ulen = length(userid)
If screenType = 1 & column = 1 Then
Do r = 1 to rows
line = substr(isfbuf,((r - 1) * zscreenw) + 1,zscreenw)
If substr(strip(line),1,1) == "*" Then
Do c = 1 to zscreenw
If substr(line,c,1) == "*" Then
shadow = overlay("R",shadow,(r - 1) * zscreenw + c,1)
Else
shadow = overlay("Y",shadow,(r - 1) * zscreenw + c,1)
End
If substr(line,7,ulen) == userid Then
Do
i = length(strip(substr(line,7,8)))
shadow=overlay("Y",shadow,(r - 1) * zscreenw + 7,ulen,"Y")
shadow=overlay("P",shadow,(r-1)*zscreenw+7+ulen,i-ulen,"P")
End
End
Return
/* Look at the copy, Finding keywords and update shadow accordingly */
/* Highlight keys for key to end of line */
Highlight_keywords_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
Return
/* Highlight to end of line for number keys */
Highlight_number_triggers_to_end_of_line:
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
Return
/* Highlight jcl verbs in // And xx lines */
Highlight_jcl:
Do r = 0 to rows
line = substr(isfbuf,zscreenw * r + 1,zscreenw)
p = pos("//",line)
If p = 0 Then
p = pos("XX",line)
If p > 0 & substr(line,p + 2,1) <> "*" Then
Do
line = substr(isfbuf,zscreenw * r + 1,zscreenw)
Do a = 1 to jclwords.0
jclword = jclwords.a
position = pos(jclword,line,p)
If position > 0 Then
Do
s = zscreenw * r + position
shadow = overlay(jcolor.a,shadow,s,jlen.a,jcolor.a)
Leave a
End
End
End
End
Return
/* Highlight real dsnames in jcl (Dsn= Only) */
Highlight_data_set_names:
Do j = 1 to 2
jclword = word("DSN= DSNAME=",j)
ln = length(jclword)
Do r = 0 to rows
line = substr(isfbuf,zscreenw * r + 1,zscreenw)
position = pos(jclword,line)
If position > 0 & substr(line,position + ln,1) <> "&" Then
Do
c = substr(line,position + ln,1)
Do p = position + ln to zscreenw While c <> " " & c <> ","
s = zscreenw * r + p
shadow = overlay("W",shadow,s,1,"W")
c = substr(line,p + 1,1)
End
End
End
End
Return
/* Highlight keywords before everything else is done */
Highlight_keywords_preprocessing:
Do a = 1 to keywords_pre.0
keyword = keywords_pre.a
wordlen = length(keyword)
position = pos(keyword,isfbufcopy)
Do While position > 0
If position = 1 Then
Do
If substr(isfbufcopy,position + wordlen,1) == " " Then
Do
pcolor = pcolor.a
plen = min(plen.a,zscreenw - (position - 1) // zscreenw)
shadow = overlay(pcolor,shadow,position,plen,pcolor)
End
End
Else
If substr(isfbufcopy,position - 1,1) == " " Then
If substr(isfbufcopy,position + wordlen,1) == " " Then
Do
pcolor = pcolor.a
plen = min(plen.a,zscreenw - (position - 1) // zscreenw)
shadow = overlay(pcolor,shadow,position,plen,pcolor)
End
position = pos(keyword,isfbufcopy,position + 1)
End
End
Return
/* Highlight keywords after everything else is done */
Highlight_keywords_postprocessing:
Do a = 1 to keywords_post.0
keyword = keywords_post.a
wordlen = length(keyword)
position = pos(keyword,isfbufcopy)
Do While position > 0
If position = 1 Then
Do
If substr(isfbufcopy,position + wordlen,1) == " " Then
Do
kcolor = kcolor.a
klen = min(klen.a,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 = min(klen.a,zscreenw - (position - 1) // zscreenw)
shadow = overlay(kcolor,shadow,position,klen,kcolor)
End
position = pos(keyword,isfbufcopy,position + 1)
End
End
Return
Highlight_find_string:
len = length(findstr)
If len > 0 Then
Do r = 0 to rows
position = 1
line = translate(substr(isfbuf,zscreenw * r + 1,zscreenw))
Do Until position = 0
position = pos(findstr,line,position)
If position > 0 Then
Do
s = zscreenw * r + position
shadow = overlay("w",shadow,s,len,"w")
position = position + len
End
End
End
Return
setup_find_string:
findstr = findstrq
If length(findstr) > 2 Then
If substr(findstr,1,1) = "*" Then
If substr(findstr,1,1) = substr(findstr,length(findstr))Then
findstr = delstr(delstr(findstr,length(findstr)),1,1)
If length(findstr) > 2 Then
If substr(findstr,1,1) = "'" | substr(findstr,1,1) = '"' Then
If substr(findstr,1,1) = substr(findstr,length(findstr))Then
findstr = delstr(delstr(findstr,length(findstr)),1,1)
Return
hello:
inline = (ISFBUF <> value('isfbuf'))
if inline=0 then Call ISPREXPX 'I'
If "ISFBUF" = value("isfbuf") Then
Do;
Say "Error in SDSF screen panel exit."
Say "Variables passed incorrectly."
Say "Calls to ISPREXPX may be missing."
Call GoodBye
End;
Call setup_find_string
Return
GoodBye:
if inline=0 then Call ISPREXPX 'T'
Return
add:
a = keywords_post.0 + 1
keywords_post.0 = a
Parse value Arg(1) With keywords_post.a "," klen.a "," kcolor.a
keywords_post.a = translate(keywords_post.a)
If klen.a = "" Then
klen.a = length(keywords_post.a)
If kcolor.a = "" Then
kcolor.a = default_highlight_color
Return
addp:
a = keywords_pre.0 + 1
keywords_pre.0 = a
Parse value Arg(1) With keywords_pre.a "," plen.a "," pcolor.a
keywords_pre.a = translate(keywords_pre.a)
If plen.a = "" Then
plen.a = length(keywords_pre.a)
If pcolor.a = "" Then
pcolor.a = default_highlight_color
Return
addt:
a = targets.0 + 1
targets.0 = a
Parse value Arg(1) With 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
addn:
a = keynums.0 + 1
keynums.0 = a
Parse value Arg(1) With 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
addj:
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" "
jlen.a = length(jclwords.a)
End
Return
initialize:
shadow = copies(" ",length(shadow))
screenType = 0
Parse Var isfln1 . display .
If display == "STATUS" | display == "OUTPUT" | display == "DA" | ,
display == "HELD" | display == "INPUT" Then
screenType = 1
If display == "SYSLOG" Then
screenType = 2
If screenType = 0 Then
Call GoodBye
default_highlight_color = "R"
Parse value 0 With keywords_pre.0 pcolor. plen.
Parse value 0 With keywords_post.0 kcolor. klen.
Parse value "0 R" With jclwords.0 jcolor. jlen.
Parse value 0 With targets.0 tcolor. tlen.
Parse value 0 With keynums.0 ncolor. nlen.
/* Make a copy of isfbuf with only alphanumerics. This will be used */
/* As the reference string for finding keyword. */
/* Set up translate table of valid keyword characters */
insert_comment: Procedure Expose ispf_is_old
'label 2 = .cmt'
Call add "*"
Call add " "
Call add " Panel modified to highlight SDSF data using"
Call add " a rexx panel exit."
Call add " "
If ispf_is_old Then
Do
Call add copies(" ",47)
Call add " "left("Requires external Rexx exec SDSFXIT",46)
Call add " "
End
Call add "*"
Call add " "
Call add " Author of hilighting exit: Doug Nadel (nadel@us.ibm.com)"
Call add " Highlighting modifications are supplied ""as-is"" and "
Call add " have no warranty of any kind."
Call add " "
Call add "*"
Return
add: Procedure
line = Arg(1)
If line = '*' Then line = copies("*",65)
line='/*'left(line,65)'*/'
"line_before .cmt = (line)"
Return
finalize : Procedure Expose ispf_is_old
Say "This panel has been changed to add panel exit logic."
If ispf_is_old Then
Do
'F )END 1'
'DEL ALL .ZCSR .ZLAST'
line = ')END'
'line_after .zlast = (line)'
lineno=1
Do Until substr(sourceline(lineno),1,3) = '/*$'
lineno = lineno + 1
End
Do Until line ='$*/'
lineno = lineno + 1
line= strip(sourceline(lineno),'T')
If line <> '$*/' Then
'LINE_AFTER .zlast = (LINE)'
End
Say " "
Say "Move all of the lines after the )END statement"
Say "to a SYSEXEC or SYSPROC data set before starting"
Say "SDSF."
'F )END first 1'
End
Else
Do
'F P"=" first'
End
Return
_________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 616 Topics: 171 Location: Stockholm, Sweden
Posted: Fri Oct 02, 2015 5:41 am Post subject:
Thanks, turns out I DID have that.
Having said that, I can't seem to get it show any colours when I actually select a job; everything's in turquoise. I'm not 100% certain I'm actually running the SDSFXIT macro since I added the line
Code:
/* REXX **************************************************************/
/* Name this Rexx exec 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 warrenty of any kind */
/*********************************************************************/
say 'Running SDSFXIT from private.code' ; trace i
Call isprexpx 'I'
Signal on Novalue
default_highlight_color = 'R'
and I never get to see the SAY. I start the code with the following macro
Joined: 20 Nov 2003 Posts: 41 Topics: 2 Location: Germany
Posted: Tue Nov 17, 2015 9:50 am Post subject:
Maybe "sdsf" is a site-specific program which itself issues LIBDEFs and ALTLIBs. So your private libraries won't get recognized.
Try to locate this program by typing "isrddn m sdsf" on any command line.
If you find "sdsf" beeing (for example) a REXX program, simply copy it, add your private libraries to it, and invoke the copied version. _________________ Stefan
There are 10 types of people in the world: Those who understand binary, and those who don't.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum