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

cao...@pitbulluk.org caoimhe at pitbulluk.org
Tue Aug 31 06:43:29 EDT 2021


On Tuesday, August 31, 2021 at 10:49:46 AM UTC+1, 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?

The search will only ever return the device name of the most recently allocated device to the process YYYYYY, which will most likely be your pipe device MPAx: because the devices are listed on separate lines.
DEVICEAUX is set in the context of the subprocess created by the pipe so the main process running the script will never see it.

What is the problem you are trying to solve?

Keith



More information about the Info-vax mailing list