HP OpenVMS Systems

ask the wizard
Content starts here

Intercepting CLI-provided command information?

» close window

The Question is:

Is there a way to view the arguments passed into a program using the c-style
for instance:
mcr []my_program arg1 arg2 arg3
then using sda or sho proc beable to view these arguments?
I have hunted far and wide, including dumping the pcb and phd of the process in
 sda with no luck.
Thanks, Jim

The Answer is :

  There is no documented way to do this, short of using a debugger
  bootstrap or other such technique to intercept the image startup.
  Of course if the program is yours, this modification is trivial,
  and involves calling available RTL routines such as lib$get_foreign
  or by using the va count and other related variable-argument C calls.
  MCR is a command used to activate the Monitor Console Routine (MCR),
  the RSX command interpreter.  The OpenVMS Wizard would encourage
  using the foreign command mechanism (DCL symbols, and particularly
  ones with a leading dollar sign), or the automatic foreign command
  mechanism (DCL$PATH) not a documented command.  Not MCR.

answer written or last revised on ( 21-NOV-2002 )

» close window