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

abrsvc dansabrservices at yahoo.com
Fri Oct 1 12:37:07 EDT 2021


On Friday, October 1, 2021 at 12:10:31 PM UTC-4, HCorte wrote:
> A quinta-feira, 2 de setembro de 2021 à(s) 17:01:43 UTC+1, Stephen Hoffman escreveu: 
> > 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
> Thanks for the links to the documentation Stephen, reading the "Run-Time Library LIB$ Routines" for the lib$spawn and status that can return SS$_NORMAL,SS$_ACCVIO,SS$_DUPLNAM ,fac$_xxx,LIB$_INVARG ,LIB$_INVSTRDES,LIB$_NOCLI 
> 
> with INCLUDE '($SSDEF)' know that the values of 
> SS$_NORMAL: 1 
> SS$_ACCVIO: 12 
> SS$_DUPLNAM: 148 
> 
> but can't find what is the library to include for remaining constants LIB$_INVARG ,LIB$_INVSTRDES,LIB$_NOCLI and fac$_xxx 
> 
> getting the following value retuned by the SPAWN routine: 231666 
> 
> know that its not LIB$_INVARG and LIB$_INVSTRDES since was able to run in simple program (lib$spawn) where the params are the same, so most likely is LIB$_NOCLI or fac$_xxx. 
> 
> could someone help in what is the name of library for the constants Status return by the routine and 231666 means what? perhaps its fac$_xxx "Other error trying to create subprocess." if so a bit vague in the probleam...


When I get a return value with no text, I usually do the following:

$  exit 231666
%DCL-E-TRMMBX, terminal has associated mailbox - terminate image and then SPAWN

Dan



More information about the Info-vax mailing list