[Info-vax] Command Procedure pass value to program READ

HCorte hmmbcorte at gmail.com
Mon Feb 7 11:13:57 EST 2022


A segunda-feira, 7 de fevereiro de 2022 à(s) 16:09:15 UTC, Arne Vajhøj escreveu:
> On 2/7/2022 10:51 AM, HCorte wrote: 
> > Is there a way when a program is run in the context of a command procedure to pass a value/string for the READ statement in case of FORTRAN. 
> > This way avoiding the user to manualy insert in the terminal a filename for example or someother parameter. 
> > 
> > script.com 
> > $!example 
> > $! DEFINE/USER_MODE SYS$INPUT SYS$COMMAND 
> > $RUN PROGRAM_EXAMPLE 
> > ---inject the input value to the READ FILENAME--- 
> > 
> > 
> > 
> > program_example.for 
> > IMPLICIT NONE 
> > CHARACTER*60 FILENAME 
> > .... 
> > 
> > 
> > WRITE(*,*) 'ENTER FILE NAME:' 
> > READ(*,*) FILENAME 
> > C write(*,*) 'File Name is: ',FILENAME 
> > ....
> $!** keep this outcommented ** DEFINE/USER_MODE SYS$INPUT SYS$COMMAND 
> $ RUN PROGRAM_EXAMPLE 
> foobar.dat 
> $ 
> $! continue with whatever 
> 
> should work. 
> 
> Arne

Thanks @Arne thats it, also so in https://community.hpe.com/t5/Operating-System-OpenVMS/VMS-How-to-pass-parameters-to-to-an-executable-through-DCL/td-p/5129590#.YgFD9OrP2Uk.



More information about the Info-vax mailing list