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

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Fri Oct 1 16:48:59 EDT 2021


In article <ab8ba8af-1275-44a2-aa59-08d2231ea505n at googlegroups.com>, HCorte <hmmbcorte at gmail.com> writes:
>A quinta-feira, 2 de setembro de 2021 =C3=A0(s) 17:01:43 UTC+1, Stephen Hof=
>fman escreveu:
>> On 2021-09-02 13:33:29 +0000, HCorte said:=20
>>=20
>> > One more question finished the command procedure, know whanted to pass=
>=20
>> > a variable/symbol to a program in fortran.
>> DCL commonly uses symbols, and logical names, and files. DECnet is also=
>=20
>> easy, IP and SSL/TLS connections lack good support.=20
>>=20
>> For Fortran, reading values from DCL symbols (lib$get_symbol),=20
>> translating values from logical names (lib$get_logical), reading the=20
>> data from the command input (works when in command procedures), reading=
>=20
>> the input from a file (generic Fortran file I/O, or using RMS from=20
>> Fortran), reading the input from the DCL output directly, and reading=20
>> the input from a network link (DECnet, as DCL doesn't play well with=20
>> UDP, TCP, SSL/TLS), etc.=20
>>=20
>> Same as usual for reading input with any other Fortran programs on OpenVM=
>S.=20
>>=20
>> Here, lib$get_symbol and lib$get_logical calls are probably the most=20
>> direct path, though I'd be tempted to use a file (possibly with=20
>> delete-on-close disposition), given you're seemingly working with a=20
>> list, and given the available Fortran sequential file I/O support.=20
>>=20
>> Biggest issue with Fortran for some of these cases tends to be parsing=20
>> data, as Fortran doesn't handle variable-length data all that well.=20
>>=20
>> The Fortran user's manual is probably a good starting point for=20
>> learning about your options and alternatives when using Fortran on=20
>> OpenVMS:=20
>> https://vmssoftware.com/docs/VSI_FORTRAN_USER.pdf=20
>>=20
>> As it can be inferred you're not completely comfortable with OpenVMS=20
>> and particularly with OpenVMS programming, some other documentation:=20
>> https://vmssoftware.com/docs/VSI_USERS_MANUAL.pdf=20
>> https://vmssoftware.com/docs/VSI_PROGRAM_CONCEPTS_VOL_I.pdf=20
>> https://vmssoftware.com/docs/VSI_PROGRAM_CONCEPTS_VOL_II.pdf=20
>>=20
>> And since I've filled this reply with RTL calls, and this in=20
>> conjunction with the Fortran user's manual (above):=20
>> https://vmssoftware.com/docs/VSI_RTL_LIB$_MANUAL.pdf
>> > Posted the question in "comp.lang.fortran" but forgoted to specify in=
>=20
>> > the initial inquiry/question that was using OpenVMS.=20
>> >=20
>> > One suggestion was to use "EXECUTE_COMMAND_LINE" that from what could=
>=20
>> > tell its specific to Unix, and also "popen" from what could get also=20
>> > Unix specific is there a equivalent for OpenVMS?
>> If you're invoking the procedure directly=E2=80=94and I'm still not entir=
>ely=20
>> clear about what this whole thread is trying to achieve=E2=80=94then call=
>ing=20
>> lib$spawn is one possibility, though there are others.
>> > $ FORTRAN /VERSION=20
>> > HP Fortran V8.2-104939-50H96=20
>> >=20
>> > $ SHOW SYSTEM=20
>> > OpenVMS V8.4
>> That's all past a dozen years old, and the HP/HPE OpenVMS versions are=20
>> no longer receiving patches.=20
>>=20
>> V8.4-2L1 (Alpha EV56 and older), V8.4-2L2, (Alpha EV6 and EV7), and=20
>> V8.4-2L3 (Itanium) are current, as is VSI Fortran V8.3-3.=20
>>=20
>>=20
>>=20
>> --=20
>> Pure Personal Opinion | HoffmanLabs LLC
>
>Thanks for the links to the documentation Stephen, reading the "Run-Time Li=
>brary LIB$ Routines" for the lib$spawn and status that can return SS$_NORMA=
>L,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

Try: $ EXIT 231666

>know that its not LIB$_INVARG and LIB$_INVSTRDES since was able to run in s=
>imple 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 er=
>ror trying to create subprocess." if so a bit vague in the probleam...

$ LIBRARY/MACRO/OUTPUT=SYS$OUTPUT SYS$LIBRARY:STARLET /EXTRACT=$LIBDEF

If you are trying to SPAWN and send output to a symbol, it won't work once
the subprocess terminates.  That symbol is sdefined in the context of the
spawned process and DCL symbols are *unique* to a process.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.



More information about the Info-vax mailing list