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

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Thu Sep 2 12:01:40 EDT 2021


On 2021-09-02 13:33:29 +0000, HCorte said:

> One more question finished the command procedure, know whanted to pass 
> a variable/symbol to a program in fortran.

DCL commonly uses symbols, and logical names, and files. DECnet is also 
easy, IP and SSL/TLS connections lack good support.

For Fortran, reading values from DCL symbols (lib$get_symbol), 
translating values from logical names (lib$get_logical), reading the 
data from the command input (works when in command procedures), reading 
the input from a file (generic Fortran file I/O, or using RMS from 
Fortran), reading the input from the DCL output directly, and reading 
the input from a network link (DECnet, as DCL doesn't play well with 
UDP, TCP, SSL/TLS), etc.

Same as usual for reading input with any other Fortran programs on OpenVMS.

Here, lib$get_symbol and lib$get_logical calls are probably the most 
direct path, though I'd be tempted to use a file (possibly with 
delete-on-close disposition), given you're seemingly working with a 
list, and given the available Fortran sequential file I/O support.

Biggest issue with Fortran for some of these cases tends to be parsing 
data, as Fortran doesn't handle variable-length data all that well.

The Fortran user's manual is probably a good starting point for 
learning about your options and alternatives when using Fortran on 
OpenVMS:
https://vmssoftware.com/docs/VSI_FORTRAN_USER.pdf

As it can be inferred you're not completely comfortable with OpenVMS 
and particularly with OpenVMS programming, some other documentation:
https://vmssoftware.com/docs/VSI_USERS_MANUAL.pdf
https://vmssoftware.com/docs/VSI_PROGRAM_CONCEPTS_VOL_I.pdf
https://vmssoftware.com/docs/VSI_PROGRAM_CONCEPTS_VOL_II.pdf

And since I've filled this reply with RTL calls, and this in 
conjunction with the Fortran user's manual (above):
https://vmssoftware.com/docs/VSI_RTL_LIB$_MANUAL.pdf

> Posted the question in "comp.lang.fortran" but forgoted to specify in 
> the initial inquiry/question that was using OpenVMS.
> 
> One suggestion was to use "EXECUTE_COMMAND_LINE" that from what could 
> tell its specific to Unix, and also "popen" from what could get also 
> Unix specific is there a equivalent for OpenVMS?

If you're invoking the procedure directly—and I'm still not entirely 
clear about what this whole thread is trying to achieve—then calling 
lib$spawn is one possibility, though there are others.

> $ FORTRAN /VERSION
> HP Fortran V8.2-104939-50H96
> 
> $ SHOW SYSTEM
> OpenVMS V8.4

That's all past a dozen years old, and the HP/HPE OpenVMS versions are 
no longer receiving patches.

V8.4-2L1 (Alpha EV56 and older), V8.4-2L2, (Alpha EV6 and EV7), and 
V8.4-2L3 (Itanium) are current, as is VSI Fortran V8.3-3.



-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list