1752565 Members
5578 Online
108788 Solutions
New Discussion юеВ

Re: LIB$SPAWN

 
Jan van den Ende
Honored Contributor

Re: LIB$SPAWN

Sk,

if you want to execute DCL in a dtetached process (or spawned from such, as you are trying), then use
$ RUN SYS$SYSTEM:LOGINOUT.EXE/INPUT=/OUTPUT=
This gives your process the CLI, which means, enables DCL.

HTH

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert_Boyd
Respected Contributor

Re: LIB$SPAWN

Instead of

$ run/proc= program_name/output=err.txt program

Create a command procedure such as

run_program_name.com

Then you can use this command:

run/proc= program_name/output=err.txt /input=disk:[dir]run_program_name.com sys$system:loginout/authorize

This will create a complete DCL environment, including running the LOGIN.COM of the username the command is run under.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: LIB$SPAWN

Ha! Jan, you and I must have been typing the same solution at the same time!

Proost!

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Sk Noorul  Hassan
Regular Advisor

Re: LIB$SPAWN

Hi,
I am trying to execute my DCL script using LIB$SPAWN inside a PASCAL program to create & enable a device on a terminal server port.

This script has to run along with the PASCAL code.
John Gillings
Honored Contributor

Re: LIB$SPAWN


>LIB$SPAWN inside a PASCAL program to
>create & enable a device on a terminal
>server port.

Why not create and enable the terminal server port directly from your program? See I/O Users Guide, Chapter Terminal Driver, in particular example 5-1 in Section 5.6.

http://h71000.www7.hp.com/doc/82FINAL/aa-pv6sg-tk/aa-pv6sg-tk.PDF

For further assistance, please log a case with your local customer support centre.
A crucible of informative mistakes
Sk Noorul  Hassan
Regular Advisor

Re: LIB$SPAWN

Hi, Is it possible to use lib$do_command in this case, inside my pascal program.If yes, what environement definition is required for this.
Pls suggest
Hein van den Heuvel
Honored Contributor

Re: LIB$SPAWN


Yes, you can use LIB$DO_COMMAND, but that work a little like the Unix 'exec' and conflicts with your requirement "This script has to run along with the PASCAL code."

As per online doc:

LIB$DO_COMMAND
Execute Command
The Execute Command routine stops program execution and directs the command language interpreter (CLI) to execute a command that you supply as the argument. If successful, LIB$DO_COMMAND does not return control to the calling program. Instead, LIB$DO_COMMAND begins execution of the specified command.

If you want control to return to the caller, use LIB$SPAWN instead.


fwiw.
Hein.
Jan van den Ende
Honored Contributor

Re: LIB$SPAWN

Sk,

LIB$DO_COMMAND -- transfers -- control to the named procedure, and EXITs your image.
That means, it is THE LAST statement in your programm that gets executed.
As far as I understand you so far, that is NOT what you try to achieve!

hth,

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Sk Noorul  Hassan
Regular Advisor

Re: LIB$SPAWN

My final executable has to run in detached mode, so when I am trying to use LIB$SPAWN, it is not able to execute my dcl script inside. But if I am running 'RUN prog_name' it is executing the required dcl script.

Pls suggest
Jan van den Ende
Honored Contributor

Re: LIB$SPAWN

Sk,

re-read yesterdays answer by Robert Boyd and myself: RUNning SYS$SYSTEM:LOGINOUT with /INPUT= will execute in an environment that knows about DCL.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.