Operating System - OpenVMS
1753480 Members
5024 Online
108794 Solutions
New Discussion юеВ

Re: passing parameters to dcl procedures run as detached processes

 
Jeff Bath
Advisor

passing parameters to dcl procedures run as detached processes

Is it possible to pass P1-P8 parameters when running a dcl procedure as a detached process?
When I create an empty command file and execute it I see that P1-P8 are defined.
This is how I am starting the procedure.
$ RUN SYS$SYSTEM:LOGINOUT.EXE -
/AUTHORIZE -
/DETACHED -
/INPUT=TESTDETACH.COM -
/PROCESS_NAME="TESTDETACH" -
/on=DEV2 -
/PRIOR=4 -
/OUTPUT=TESTDETACH.LOG -
/ERROR=TESTDETACH.ERR -
5 REPLIES 5
Volker Halle
Honored Contributor

Re: passing parameters to dcl procedures run as detached processes

Jeff,

no, this is not possible. There is special handling for parameters P1 to P8 and BATCH$RESTART in LOGINOUT and the CLI for BATCH processes only.

As another method to pass parameters to detached processes, you could use logical names (with DEFINE/CLUSTER if you want them to be available clusterwide as indicated by /on=DEV2 in your example).

Or you could write a temporary input file containing the parameters and the invocation of @TESTDETACH.COM p1 ... p8 and use this file as the /INPUT=... file.

Volker.
Jeff Bath
Advisor

Re: passing parameters to dcl procedures run as detached processes

I actually to something similiar to the second example. I was looking to simplify the process a little. I played around with a mailbox but I figured that was just making things all little to complicated.

I don't think define/cluster works until VMS 8.2 or 8.3 we are using 7.3-2 so I need to do define/table=lnm$syscluster....

Thanks for the info.
Peter Quodling
Trusted Contributor

Re: passing parameters to dcl procedures run as detached processes

IN one client environment, I routine use logicals as ways of passing parameters to an already operating batch job. (Actually web server netserver processes...)

Q
Leave the Money on the Fridge.
Phillip Thayer
Esteemed Contributor

Re: passing parameters to dcl procedures run as detached processes

Logical names would be the best bet although there are several differenct ways of passing the paramters. For example the .COM could be something like

$RUN PROGRAM.EXE
PARAMTER1-VALUE
PARAMETER2-VALUE
.
.
.
PARAMETERN-VALUE
$ rest of the .com file after this

Then the PROGRAM.EXE would simply use a read from the default input channel to get the values.

This is not the ideal way though. Logical names are best for passing small amounts of data between programs (1 - 256 bytes), Mailboxes are best for larger amounts of data (256-2048 bytes depending on your SYSGEN DEFMBXBUFQUO parameter value) and files are best for large blocks of data (>2048 bytes or the value of the SYSGEN DEFMBXBUFQUO value). Depending on the amount of data that you need to send in the p1-p8 type of parameter you should choose which method to use.

Phil
Once it's in production it's all bugs after that.
John Gillings
Honored Contributor

Re: passing parameters to dcl procedures run as detached processes

Jeff,

As others have explained, there is no direct mechanism for passing parameters into a command procedure executing in a detached process, but it's a very simple matter to create a jacket procedure to do it and then delete itself. Extending your example:


$ OPEN/WRITE jack JACKET.COM
$ WRITE jack "$ @TESTDETACH ""''p1'"" ""''p2'"" etc.."
$ WRITE jack "$ DELETE 'F$ENVIRONMENT(""PROCEDURE"")'"
$ CLOSE jack
$
$ RUN SYS$SYSTEM:LOGINOUT.EXE -
/AUTHORIZE -
/DETACHED -
/INPUT=JACKET.COM -
/PROCESS_NAME="TESTDETACH" -
/on=DEV2 -
/PRIOR=4 -
/OUTPUT=TESTDETACH.LOG -
/ERROR=TESTDETACH.ERR -
...
A crucible of informative mistakes