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

Jim mckinneyj at leidos.com
Tue Aug 31 08:11:59 EDT 2021


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


Maybe pass the value of the SEARCH output back to the parent process using a job logical name...

$ pipe/nosymbol/nological -
    show process YYYYYY | -
    search sys$pipe "Devices allocated:" | -
    ( read sys$pipe x ; define/job x &x )
$ device_aux = f$element(1,":",f$edit(f$trnlnm("x","lnm$job"),"collapse"))
$ deassign/job x
$ show symbol device_aux



More information about the Info-vax mailing list