Operating System - OpenVMS
1829526 Members
1817 Online
109991 Solutions
New Discussion

Re: Strange behaviour from DCL PIPE

 
SOLVED
Go to solution
Jimson_1
Frequent Advisor

Strange behaviour from DCL PIPE

Hi,

Can anyone explain the following behaviour to me.

1. Create the following command procedure:

$ create a.com
$ write sys$output "This works : _TNA366:" ! use your terminal process name
$ write sys$output "This doesn't work : ''f$getjpi("","TT_PHYDEVNAM")'"



2. Execute it:

$ @a.com
This works : _TNA366:
This doesn't work : _TNA366:


3. Now, try the following PIPE command

$ pipe @a.com | search sys$input TNA366
This works : _TNA366:


Why couldn't it find the second string?

JamesP

7 REPLIES 7
Wim Van den Wyngaert
Honored Contributor

Re: Strange behaviour from DCL PIPE

pipe show proc | type sys$input

Answer : because the process has no terminal.

Wim
Wim
Volker Halle
Honored Contributor
Solution

Re: Strange behaviour from DCL PIPE

JamesP,

welcome to the OpenVMS ITRC forum.

Pipes are implemented using sub-processes, which may not have an associated terminal. That's why TT_PHYDEVNAM is returned as an empty string.

Volker.
Wim Van den Wyngaert
Honored Contributor

Re: Strange behaviour from DCL PIPE

The logical tt is however still pointing to your terminal.

pipe write sys$output f$tr("tt") | type sys$input
FTA14:

Wim
Wim
Jimson_1
Frequent Advisor

Re: Strange behaviour from DCL PIPE

Of course...

Why didn't I think of that?

Cheers guys
Jan van den Ende
Honored Contributor

Re: Strange behaviour from DCL PIPE

James,

first,
WELCOME to the VMS forum!

please review
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
to thank those that helped

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Karl Rohwedder
Honored Contributor

Re: Strange behaviour from DCL PIPE

You may make use of the MASTER_PID functin to obtain information of the master process inside the pipe, e.g.

$ write sys$output "This works : _TNA366:" ! use your terminal process name
$ pid = F$Getjpi("","MASTER_PID")
$ write sys$output "This doesn't work : ''f$getjpi(PID,"TT_PHYDEVNAM")'"

regards Kalle
Jimson_1
Frequent Advisor

Re: Strange behaviour from DCL PIPE

Problem solved.
Thanks