[Info-vax] Command Procedure Pipe output to a variable

MG marcogbNO at SPAMxs4all.nl
Tue Aug 31 06:57:26 EDT 2021


On 31-Aug-2021 11:49, HCorte wrote:
> Implementing a command procedure that first obtains the device allocated 
> to a process for example purposes called YYYYYY.
> 
> How to output the results of (SEARCH SYS$INPUT "Devices allocated") to 
> the variable DEVICEAUX tried (READ SYS$PIPE DEVICEAUX) but with no success.
> 
> $ pipe SH PROCESS YYYYYY | SEARCH SYS$INPUT "Devices allocated" | (READ SYS$PIPE DEVICEAUX)
> $ WRITE SYS$OUTPUT DEVICEAUX
> $ DEVICE_AUX = F$EDIT(F$ELEMENT(1, ":", TEST),"TRIM")
> $ WRITE SYS$OUTPUT DEVICE_AUX
> 
> can make it work to write to a file
> $ pipe SH PROCESS SCMLCOMOLM | SEARCH SYS$PIPE "Devices allocated" > DEVICEAUX.DAT
> 
> but would prefer to avoid having to write and read from file if possible, 
> also in command procedure should alls use SYS$PIPE instead of SYS$INPUT?

This is a recurring question and I think just about anyone getting
started with DCL wondered about this at some point in time.

I'm afraid that there's little to nothing 'natively' in DCL (except
of course lexicals) like you'd have in e.g. *n*x Bourne shell, besides
writing to a (temporary) file and.  But, besides that, for the rest
nothing but hacks and workarounds that typically involve writing an
external program that can be called to receive the piped data and
write it to one or more symbols.  (The latter is what I did myself,
with some varying results.)

  - MG



More information about the Info-vax mailing list