/* rexx */ address syscall say right('PID',10) right('PPID',10) ' TIME' 'COMMAND' say '>'left('TTY',8) left('USER',8) left('GROUP',8), left('START GMT',16) left('SERVER NAME',12) ps.0=0 'getpsent ps.' /* get process data */ do i=1 to ps.0 /* process each entry returned */ tskt = ps.i.ps_usertime+ps.i.ps_systime /* system + user */ t=(tskt + 50) % 100 /* change time to seconds */ mm = t%60 /* derive minutes */ ss = t//60 /* derive seconds */ hh = mm%60 /* derive hours */ mm = mm//60 /* derive minute remainder */ if hh=0 then , /* set hours: samp ignores day */ h=' ' else , h=right(hh,2,0)':' m=right(mm,2,0)':' /* set minutes */ parse value reverse(ps.i.ps_contty), with tty '/' /* get tty filename */ tty=reverse(tty) 'getpwuid 'ps.i.ps_euid' pw.' /* who are we ? */ 'getgrgid 'ps.i.ps_egid' gr.' /* who are we ? */ 'gmtime 'ps.i.ps_starttime' gm.' /* convert to display */ day = right(gm.tm_mday,2,0) /* derive day */ min = right(gm.tm_min,2,0) /* derive min */ mo = right(gm.tm_mon,2,0) /* derive month */ hr = right(gm.tm_hour,2,0) /* derive hour */ on = gm.tm_year'/'mo'/'day' 'hr':'min say right(ps.i.ps_pid,10), /* display process id */ right(ps.i.ps_ppid,10), /* display parent */ h || m || right(ss,2,0), /* display process time */ ps.i.ps_cmd /* display command */ say '>'left(tty,8), /* display parent */ left(pw.pw_name,8), /* display user */ left(gr.gr_name,8), /* display group */ left(on,16), /* display date */ left(ps.i.ps_servername,12) /* display server */ end exit 0