Article 158304 of comp.os.vms:
One slick DCL trick is to list the files open by a process.
The following procedure is supplied by Oracle for this purpost

(Note lack of redistribution restrictions)
----------------------------------------------------------------------------
------------------------
$! 
$!  files.com 
$! 
$! NAME:	% - Copyright (c) 1989 by Oracle Corporation
$! USAGE:
$! FUNCTION:
$! MODIFIED:
$!   CCongdon  09/29/95 - #308601 - Graceful exit if insufficient privs
(CWC0091)
$!   CCongdon  06/23/94 - Quiet delete
$!   CCongdon  03/16/94 - Be a little more careful with $status
$!   maporter  07/11/91 - Fix bug with SDA-NOPROC 
$!   Porter    03/18/91 - Make process names and pids work right
$!   Porter    01/31/91 - Cleanup temp files
$!   Porter    03/27/89 - Creation
$!-------------------------------------------
$!
$! FILES.COM
$!
$! Given either a PID or a process name, 
$!   show any files that the process has channels to.
$!   p1 is the pid or process name
$!   p2 may optionally be a selection string
$!     MB gives mailboxes
$! 
$! This file runs SDA and thus, requires that the user have CMKRNL.
$!
$! Get process name from either pid or process name
$!
$
$ if (.not. f$privilege("CMKRNL")) then -
     goto insuff_priv_exit
$!
$ on control_y then goto control_y_exit
$!
$ set message/nofac/noid/nosev/notext           
$ if p1.eqs."" 
$ then 
$   write sys$Output "(using current process)"
$   p1 = f$getjpi(0,"PID")      
$ endif
$
$! Determine whether we got a PID or a PRCNAM.
$! This is a total hack
$ pid = ""
$ on warning then continue
$ pid = f$getjpi(p1,"PID")
$ if pid.eqs.""
$ then ! We must have gotten a process name
$   got_pid = 0
$ else
$   got_pid = 1
$ endif
$
$ set message/fac/id/sev/text
$
$ on warning then goto error_exit
$
$ tempout = "sys$scratch:files''f$getjpi(0,"PID")'.out"
$ tempcom = "sys$scratch:files''f$getjpi(0,"PID")'.com"
$
$! Now that we have the process name, write out the com file to run
$ if f$trnlnm("comfile").nes."" then close comfile
$ open/write comfile 'tempcom'
$ write comfile "$ define sys$output ''tempout'"
$ write comfile "$ analyze/system"
$ if got_pid 
$ then 
$   write comfile "set process/index=''p1'"
$ else 
$   write comfile "set process """,p1,""""
$ endif
$ write comfile "show process/channels"
$ write comfile "$ deassign sys$output"
$ close comfile
$
$! and run it.
$ @'tempcom'
$ temp = ""
$! 
$! See if we found the process
$ set message/nosev/nofac/noid/notext
$ search/output=nla0: 'tempout' "%SDA-E-BADPROC"
$ sts = '$status
$ set message/sev/fac/id/text
$ sts[4,28] = 0   ! to mask off the high bits
$ if (sts .eq. 1) 
$ then
$   write sys$output "Error: Could not find process ''p1'"
$ else
$   if p2.nes."" then temp = "  0" 
$   search/nohighlight/match=and 'tempout' "''temp'","''p2'"
$ endif
$ goto exit
$
$ERROR_EXIT:
$  write sys$Output "Error encountered: ",f$message($status)
$  goto exit
$CONTROL_Y_EXIT:
$  write sys$Output "Ctrl-y detected. Exiting"
$  goto exit
$INSUFF_PRIV_EXIT:
$  write sys$Output "Error:"
$  write sys$Output "   You must have the CMKRNL privilege to use this
utility."
$  write sys$Output "   Exiting..."
$  goto exit
$EXIT:
$  if f$trnlnm("comfile").nes."" then close comfile
$  if ("''tempout'" .nes. "") then -
      delete/nolog/noconfirm 'tempout';*
$  if ("''tempcom'" .nes. "") then -
      delete/nolog/noconfirm 'tempcom';*
$  set message/fac/id/sev/text
$  exit 

-- 
Noah B. Hart, Systems Administrator
noah@lipman.com  --  www.lipman.com/noah




