Operating System - OpenVMS
1751978 Members
4595 Online
108784 Solutions
New Discussion юеВ

Re: F$ENV("PROCEDURE") in detached process

 
SOLVED
Go to solution

F$ENV("PROCEDURE") in detached process

F$ENV("PROCEDURE") called in detached process
gives only NAME.TYPE instead of expected full file.spec. OpenVMS version V7.3-2. Please explain why.
Test comproc: (TMP.COM)
$ write sys$output f$env("procedure")
Interactive test:
$ @tmp
USER$DISK:[EDTTSZ]TMP.COM;50
Detached process test:
$ run /input=tmp.com /out=tmp.log sys$system:loginout
%RUN-S-PROC_ID, identification of created process is 000DB60D
$ type tmp.log
$ write sys$output f$env("procedure")
TMP.COM
15 REPLIES 15
Wim Van den Wyngaert
Honored Contributor

Re: F$ENV("PROCEDURE") in detached process

In detached sys$login is not defined (and sys$scratch neither). And your input file is sys$login:tmp.com.

try specifying the full path and it will work.

Wim
Wim
Jan van den Ende
Honored Contributor

Re: F$ENV("PROCEDURE") in detached process

Teofil,

Wim said it.

But if you WANt or NEED a DCL environment in your detached process, then
RUN SYS$SYSTEM:LOGINOUT.EXE/INPUT=/OUTPUT=/ERROR=
hth

Proost.

Have one on me.

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

Re: F$ENV("PROCEDURE") in detached process

Both SYS$LOGIN and SYS$SCRATCH are defined.
New test with this com.proc.
$ set nover
$ show log sys$login
$ show log sys$scratch
$ write sys$output f$env("procedure")
Run command:
$ run /input=tmp.COM /out=tmp.log sys$system:loginout
%RUN-S-PROC_ID, identification of created process is 0008A863
$ type tmp.log
$ set nover
"SYS$LOGIN" = "USER$DISK:[EDTTSZ]" (LNM$JOB_81975300)
"SYS$SCRATCH" = "USER$DISK:[EDTTSZ]" (LNM$JOB_81975300)
TMP.COM

Note that ANAL /SYS (sho proc /id=/chan)
displays full filespec input file.
Other tests show that f$env("PROCEDURE") just takes the value of /INPUT for despatched processes.


Re: F$ENV("PROCEDURE") in detached process

... detached processes , not "despatched processes" should be, of course / t.
Jan van den Ende
Honored Contributor

Re: F$ENV("PROCEDURE") in detached process

Teofil,

>>>
Other tests show that f$env("PROCEDURE") just takes the value of /INPUT for despatched processes.
<<<

... which is exactly what you ask of it!

Try this TMP.COM

$! TMP.COM
$ @:
You will see that NOW you get NOT TMP.COM, but the @-ed COM file. This is exactly what f$ENVIR("PROCEDURE") is documented to do: return the currently executing command procedure.

Proost.

Have one on me.

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

Re: F$ENV("PROCEDURE") in detached process

The help says: (help lex f$env atr)
"File specification of the current command
procedure."
It is what I expected: file specification.
Interactive does it, batch does it. Why not detached?
In the future I'll use
f$sear(f$env("procedure"))
instead for only f$env("procedure")

Thank you for your answers.
Regards --- Teofil
Wim Van den Wyngaert
Honored Contributor

Re: F$ENV("PROCEDURE") in detached process

You are right : it's when you run loginout with /detached that you don't get sys$login.

But it's still solved when you specify the full path name.

Wim
Wim
Wim Van den Wyngaert
Honored Contributor
Solution

Re: F$ENV("PROCEDURE") in detached process

It seems that if you do @, the correct thing is displayed.

But in detached, it displays exactly what you passed as input file name.

E.g. @xxxxx:tmp will show xxxxx:tmp (not xxxxx:tmp.com !).

Wim
Wim
Wim Van den Wyngaert
Honored Contributor

Re: F$ENV("PROCEDURE") in detached process

In the future I'll use
f$sear(f$env("procedure"))
instead for only f$env("procedure")


Be sure that your default dir hasn't changed.

Wim
Wim