Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

All the existing 2.0.x kernels are to buggy for 2.1.x to be the main goal. -- Alan Cox


computers / comp.os.vms / Re: How to send multiple commands to a DCL subprocess?

SubjectAuthor
* How to send multiple commands to a DCL subprocess?Jake Hamby
+- Re: How to send multiple commands to a DCL subprocess?VAXman-
+- Re: How to send multiple commands to a DCL subprocess?Craig A. Berry
`* Re: How to send multiple commands to a DCL subprocess?Arne Vajhøj
 `* Re: How to send multiple commands to a DCL subprocess?VAXman-
  +- Re: How to send multiple commands to a DCL subprocess?Arne Vajhøj
  +- Re: How to send multiple commands to a DCL subprocess?Jake Hamby
  `* Re: How to send multiple commands to a DCL subprocess?Jake Hamby
   `* Re: How to send multiple commands to a DCL subprocess?Jake Hamby
    +- Re: How to send multiple commands to a DCL subprocess?Jake Hamby
    +- Re: How to send multiple commands to a DCL subprocess?Arne Vajhøj
    `* Re: How to send multiple commands to a DCL subprocess?Craig A. Berry
     `- Re: How to send multiple commands to a DCL subprocess?Jake Hamby

1
How to send multiple commands to a DCL subprocess?

<0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22917&group=comp.os.vms#22917

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:1bc7:b0:45b:85e:e5a4 with SMTP id m7-20020a0562141bc700b0045b085ee5a4mr19258662qvc.57.1653360894772;
Mon, 23 May 2022 19:54:54 -0700 (PDT)
X-Received: by 2002:ad4:574e:0:b0:461:e896:b653 with SMTP id
q14-20020ad4574e000000b00461e896b653mr19334581qvx.91.1653360894591; Mon, 23
May 2022 19:54:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Mon, 23 May 2022 19:54:54 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:d24d:b102:6721:2a38;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:d24d:b102:6721:2a38
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
Subject: How to send multiple commands to a DCL subprocess?
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Tue, 24 May 2022 02:54:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4841
 by: Jake Hamby - Tue, 24 May 2022 02:54 UTC

I've been working on updating the open source Regina Rexx interpreter to revive the native support it has for VMS, and I have a question about how best to create a mailbox/pipe for sending multiple DCL commands to a spawned subprocess via SYS$INPUT.

Regina tries to execute anything it doesn't recognize as a system command. I've adapted the UNIX version of the code, which uses fork()/exec*(), to instead use vfork(). That code works fine for .EXE files, but it doesn't work for running arbitrary DCL commands (there's a long "vms.rexx" test script that I'm trying to run that's filled with them), so I had to revive some code in the Regina port to use lib$spawn() instead. Here's my latest version of the relevant file, after I removed several functions to create input and output mailboxes:

https://github.com/jhamby/vms-regina/blob/jhamby/vms-fixes/vmscmd.c

I created a short AST to call on subprocess completion that closes the output stream, if it's redirected, after writing an EOF to it, which I discovered was necessary in order for the UNIX poll()-based code that feeds inputs and outputs into Regina to work. Otherwise it didn't receive any output from the DCL command. So that takes care of the output (it'd be nice if I could set SYS$ERROR separately from SYS$OUTPUT, but it's not a big deal).

The problem I have now is that, on the input side, calling getname() to get the mailbox name of a created pipe() to pass as SYS$INPUT in my lib$spawn() call works for one command, but not when I try to send multiple "\n" separated commands. I have the DECC$ feature flags set to enable stream-oriented pipes without carriage control, and I suspect that carriage control is part of the problem, because the error output I'm getting from DCL is the same as if the two lines of DCL commands were jammed together with no separation.

But I've tried disabling DECC$STREAM_PIPE and DECC$POPEN_NO_CRLF_REC_ATTR, which were both enabled, and that didn't make any difference. I've tried "\r\n" instead of "\n", but I suspect that I need to do something else as well, perhaps writing each line using a separate write() call?

What would be the best way for me to set up a pipe to use for the subprocess's input that I can use to send multiple lines to DCL from my code? Is it possible to use pipe() like I'm doing now, or do I have to call $crembx() myself in order to create a non-stream mailbox? Once I've created the mailbox, what's the recommended strategy for writing individual lines (from C)?

Additional detail: where I'm stuck in the vms.rexx test script is that it's sending multiple commands via redirected SYS$INPUT with the DCL command "set def nl:" The Rexx command, with redirection, looks like:

'LIFO> set def nl: >FIFO'

I can feed one additional DCL command via SYS$INPUT from the Rexx queue, but no more. I assume that since the test script did work at some point in the distant past, that this must be a valid way to send multiple commands to DCL, so I'm hoping that the only detail that I'm missing is how to set up and write to a pipe in the proper VMS style so that DCL will accept and recognize separate lines of input. Right now I'm getting a DCL error that's the same as if the two lines had been concatenated together with no newline separator ("%DCL-W-UNDSYM, undefined symbol - check validity and spelling \SYS$OUTPUT\").

Any suggestions would save me a great deal of trial and error. I've been trying to learn as *little* as possible about VMS record-oriented mailboxes, but I think this is one case where the UNIX stream style won't work. Thanks in advance!

Jake

Re: How to send multiple commands to a DCL subprocess?

<00B752CA.95BD6063@SendSpamHere.ORG>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22920&group=comp.os.vms#22920

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!aioe.org!pr9o9uw/KLhPSFYv2ok3sg.user.46.165.242.75.POSTED!not-for-mail
From: VAXm...@SendSpamHere.ORG
Newsgroups: comp.os.vms
Subject: Re: How to send multiple commands to a DCL subprocess?
Date: Tue, 24 May 2022 11:44:38 GMT
Organization: c.2022 Brian Schenkenberger. Prior employers of copyright holder and their agents must first obtain written permission to copy this posting.
Message-ID: <00B752CA.95BD6063@SendSpamHere.ORG>
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
Reply-To: VAXman- @SendSpamHere.ORG
Injection-Info: gioia.aioe.org; logging-data="63718"; posting-host="pr9o9uw/KLhPSFYv2ok3sg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: VAXm...@SendSpamHere.ORG - Tue, 24 May 2022 11:44 UTC

In article <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>, Jake Hamby <jake.hamby@gmail.com> writes:
>I've been working on updating the open source Regina Rexx interpreter to re=
>vive the native support it has for VMS, and I have a question about how bes=
>t to create a mailbox/pipe for sending multiple DCL commands to a spawned s=
>ubprocess via SYS$INPUT.
>
>Regina tries to execute anything it doesn't recognize as a system command. =
>I've adapted the UNIX version of the code, which uses fork()/exec*(), to in=
>stead use vfork(). That code works fine for .EXE files, but it doesn't work=
> for running arbitrary DCL commands (there's a long "vms.rexx" test script =
>that I'm trying to run that's filled with them), so I had to revive some co=
>de in the Regina port to use lib$spawn() instead. Here's my latest version =
>of the relevant file, after I removed several functions to create input and=
> output mailboxes:
>
>https://github.com/jhamby/vms-regina/blob/jhamby/vms-fixes/vmscmd.c
>
>I created a short AST to call on subprocess completion that closes the outp=
>ut stream, if it's redirected, after writing an EOF to it, which I discover=
>ed was necessary in order for the UNIX poll()-based code that feeds inputs =
>and outputs into Regina to work. Otherwise it didn't receive any output fro=
>m the DCL command. So that takes care of the output (it'd be nice if I coul=
>d set SYS$ERROR separately from SYS$OUTPUT, but it's not a big deal).
>
>The problem I have now is that, on the input side, calling getname() to get=
> the mailbox name of a created pipe() to pass as SYS$INPUT in my lib$spawn(=
>) call works for one command, but not when I try to send multiple "\n" sepa=
>rated commands. I have the DECC$ feature flags set to enable stream-oriente=
>d pipes without carriage control, and I suspect that carriage control is pa=
>rt of the problem, because the error output I'm getting from DCL is the sam=
>e as if the two lines of DCL commands were jammed together with no separati=
>on.

ROTFLMFAO!

$ CRLF[0,16]=%x0A0D
$ COMMAND:="SHOW DEFAULT"
$ SPAWN 'COMMAND
%DCL-S-SPAWNED, process SYSTEM_14176 spawned
%DCL-S-ATTACHED, terminal now attached to process SYSTEM_14176
SYS$SYSROOT:[SYSMGR]
= SYS$SYSROOT:[SYSMGR]
= SYS$COMMON:[SYSMGR]
%DCL-S-RETURNED, control returned to process SYSTEM
$ COMMAND:="SHOW DEFAULT''CRLF'SET DEFAULT SYS$SYSTEM''CRLF'SHOW DEFAULT"
$ SPAWN 'COMMAND
%DCL-S-SPAWNED, process SYSTEM_34737 spawned
%DCL-S-ATTACHED, terminal now attached to process SYSTEM_34737
%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
\DEFAULT
SET\
%DCL-S-RETURNED, control returned to process SYSTEM
%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling

In other words, it won't work! You need to approach multiple command in
a different way because the input is record oriented. Now, watch this:

$ CREATE/MAILBOX SUBPROC$INPUT
$ SPAWN/NOWAIT/INPUT=SUBPROC$INPUT
%DCL-S-SPAWNED, process SYSTEM_58103 spawned
$ OPEN/WRITE CMD SUBPROC$INPUT
$ WRITE CMD "SHOW DEFAULT"
SYS$SYSROOT:[SYSMGR]
= SYS$SYSROOT:[SYSMGR]
= SYS$COMMON:[SYSMGR]
$ WRITE CMD SUBPROC$INPUT
$ WRITE CMD "SET DEFAULT SYS$SYSTEM" !<-- there's no output from command
$ WRITE CMD "SHOW DEFAULT"
SYS$SYSROOT:[SYSEXE]
= SYS$SYSROOT:[SYSEXE]
= SYS$COMMON:[SYSEXE]
$ WRITE CMD "LOGOUT/FULL"
SYSTEM job terminated at 24-MAY-2022 07:34:26.87

Accounting information:
Buffered I/O count: 244 Peak working set size: 2288
Direct I/O count: 0 Peak virtual size: 172560
Page faults: 125 Mounted volumes: 0
Charged CPU time: 0 00:00:00.03 Elapsed time: 0 00:07:45.54

>But I've tried disabling DECC$STREAM_PIPE and DECC$POPEN_NO_CRLF_REC_ATTR, =
>which were both enabled, and that didn't make any difference. I've tried "\=
>r\n" instead of "\n", but I suspect that I need to do something else as wel=
>l, perhaps writing each line using a separate write() call?

SEE ABOVE!

>What would be the best way for me to set up a pipe to use for the subproces=
>s's input that I can use to send multiple lines to DCL from my code? Is it =
>possible to use pipe() like I'm doing now, or do I have to call $crembx() m=
>yself in order to create a non-stream mailbox? Once I've created the mailbo=
>x, what's the recommended strategy for writing individual lines (from C)?

SEE ABOVE!

>Additional detail: where I'm stuck in the vms.rexx test script is that it's=
> sending multiple commands via redirected SYS$INPUT with the DCL command "s=
>et def nl:" The Rexx command, with redirection, looks like:
>
>'LIFO> set def nl: >FIFO'
>
>I can feed one additional DCL command via SYS$INPUT from the Rexx queue, bu=
>t no more. I assume that since the test script did work at some point in th=
>e distant past, that this must be a valid way to send multiple commands to =
>DCL, so I'm hoping that the only detail that I'm missing is how to set up a=
>nd write to a pipe in the proper VMS style so that DCL will accept and reco=
>gnize separate lines of input. Right now I'm getting a DCL error that's the=
> same as if the two lines had been concatenated together with no newline se=
>parator ("%DCL-W-UNDSYM, undefined symbol - check validity and spelling \SY=
>S$OUTPUT\").
>
>Any suggestions would save me a great deal of trial and error. I've been tr=
>ying to learn as *little* as possible about VMS record-oriented mailboxes, =
>but I think this is one case where the UNIX stream style won't work. Thanks=
> in advance!

IF you are expecting ANYTHING you sent to the SUBPROCESS to affect the process
in which you are running your Rexx, you will be greatly disappointed. Look at
my DCL example. The subprocess default was set to SYS$SYSTEM but the process
which spawned the subproces remains unaffected in its current default. If the
Rexx commands in your Rexx 'script' affecting the current process, you will be
rather disappointed in the outcome sending its DCL commands to a subprocess.

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

I speak to machines with the voice of humanity.

Re: How to send multiple commands to a DCL subprocess?

<t6imed$rtv$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22922&group=comp.os.vms#22922

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: craigbe...@nospam.mac.com (Craig A. Berry)
Newsgroups: comp.os.vms
Subject: Re: How to send multiple commands to a DCL subprocess?
Date: Tue, 24 May 2022 08:26:35 -0500
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <t6imed$rtv$1@dont-email.me>
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 May 2022 13:26:37 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="56df1bdb1d7a4ebf767db631a8587ef1";
logging-data="28607"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/N0HT2M6htBs8TqMJsWS5Ci0uumUu9mNw="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.0
Cancel-Lock: sha1:nAbHlgE41ouRmVkIgQqgaRUgn4Q=
In-Reply-To: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
Content-Language: en-US
 by: Craig A. Berry - Tue, 24 May 2022 13:26 UTC

On 5/23/22 9:54 PM, Jake Hamby wrote:

> The problem I have now is that, on the input side, calling getname()
> to get the mailbox name of a created pipe() to pass as SYS$INPUT in my
> lib$spawn() call works for one command, but not when I try to send
> multiple "\n" separated commands. I have the DECC$ feature flags set to
> enable stream-oriented pipes without carriage control, and I suspect
> that carriage control is part of the problem, because the error output
> I'm getting from DCL is the same as if the two lines of DCL commands
> were jammed together with no separation.

Try sending the commands in separate writes with an fsync() in the
writer on the pipe's file descriptor after each command. On the CRTL's
mailbox-based pipes, that will give you a new record in the mailbox
regardless of whatever stream emulation is set. I'm not sure this will
solve your problem, but it's the first thing that occurred to me to try.

Re: How to send multiple commands to a DCL subprocess?

<628d6de1$0$699$14726298@news.sunsite.dk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22948&group=comp.os.vms#22948

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Tue, 24 May 2022 19:44:27 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Subject: Re: How to send multiple commands to a DCL subprocess?
Content-Language: en-US
Newsgroups: comp.os.vms
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
From: arn...@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 78
Message-ID: <628d6de1$0$699$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: fd4617ba.news.sunsite.dk
X-Trace: 1653435873 news.sunsite.dk 699 arne@vajhoej.dk/68.9.63.232:50706
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Tue, 24 May 2022 23:44 UTC

On 5/23/2022 10:54 PM, Jake Hamby wrote:
> I've been working on updating the open source Regina Rexx interpreter
> to revive the native support it has for VMS, and I have a question
> about how best to create a mailbox/pipe for sending multiple DCL
> commands to a spawned subprocess via SYS$INPUT.
>
> Regina tries to execute anything it doesn't recognize as a system
> command. I've adapted the UNIX version of the code, which uses
> fork()/exec*(), to instead use vfork(). That code works fine for .EXE
> files, but it doesn't work for running arbitrary DCL commands
> (there's a long "vms.rexx" test script that I'm trying to run that's
> filled with them), so I had to revive some code in the Regina port to
> use lib$spawn() instead. Here's my latest version of the relevant
> file, after I removed several functions to create input and output
> mailboxes:
>
> https://github.com/jhamby/vms-regina/blob/jhamby/vms-fixes/vmscmd.c
>
> I created a short AST to call on subprocess completion that closes
> the output stream, if it's redirected, after writing an EOF to it,
> which I discovered was necessary in order for the UNIX poll()-based
> code that feeds inputs and outputs into Regina to work. Otherwise it
> didn't receive any output from the DCL command. So that takes care of
> the output (it'd be nice if I could set SYS$ERROR separately from
> SYS$OUTPUT, but it's not a big deal).
>
> The problem I have now is that, on the input side, calling getname()
> to get the mailbox name of a created pipe() to pass as SYS$INPUT in
> my lib$spawn() call works for one command, but not when I try to send
> multiple "\n" separated commands. I have the DECC$ feature flags set
> to enable stream-oriented pipes without carriage control, and I
> suspect that carriage control is part of the problem, because the
> error output I'm getting from DCL is the same as if the two lines of
> DCL commands were jammed together with no separation.
>
> But I've tried disabling DECC$STREAM_PIPE and
> DECC$POPEN_NO_CRLF_REC_ATTR, which were both enabled, and that didn't
> make any difference. I've tried "\r\n" instead of "\n", but I suspect
> that I need to do something else as well, perhaps writing each line
> using a separate write() call?
>
> What would be the best way for me to set up a pipe to use for the
> subprocess's input that I can use to send multiple lines to DCL from
> my code? Is it possible to use pipe() like I'm doing now, or do I
> have to call $crembx() myself in order to create a non-stream
> mailbox? Once I've created the mailbox, what's the recommended
> strategy for writing individual lines (from C)?
>
> Additional detail: where I'm stuck in the vms.rexx test script is
> that it's sending multiple commands via redirected SYS$INPUT with the
> DCL command "set def nl:" The Rexx command, with redirection, looks
> like:
>
> 'LIFO> set def nl: >FIFO'
>
> I can feed one additional DCL command via SYS$INPUT from the Rexx
> queue, but no more. I assume that since the test script did work at
> some point in the distant past, that this must be a valid way to send
> multiple commands to DCL, so I'm hoping that the only detail that I'm
> missing is how to set up and write to a pipe in the proper VMS style
> so that DCL will accept and recognize separate lines of input. Right
> now I'm getting a DCL error that's the same as if the two lines had
> been concatenated together with no newline separator ("%DCL-W-UNDSYM,
> undefined symbol - check validity and spelling \SYS$OUTPUT\").
>
> Any suggestions would save me a great deal of trial and error. I've
> been trying to learn as *little* as possible about VMS
> record-oriented mailboxes, but I think this is one case where the
> UNIX stream style won't work. Thanks in advance!

I don't have an explanation for your specific problem.

But my experience is that LIB$SPANW is problematic for general
DCL commands - it is much better to create a pseudo terminal
(ptd$ functions).

Arne

Re: How to send multiple commands to a DCL subprocess?

<00B7539F.E8A0F79C@SendSpamHere.ORG>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22962&group=comp.os.vms#22962

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!pr9o9uw/KLhPSFYv2ok3sg.user.46.165.242.75.POSTED!not-for-mail
From: VAXm...@SendSpamHere.ORG
Newsgroups: comp.os.vms
Subject: Re: How to send multiple commands to a DCL subprocess?
Date: Wed, 25 May 2022 13:11:40 GMT
Organization: c.2022 Brian Schenkenberger. Prior employers of copyright holder and their agents must first obtain written permission to copy this posting.
Message-ID: <00B7539F.E8A0F79C@SendSpamHere.ORG>
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com> <628d6de1$0$699$14726298@news.sunsite.dk>
Reply-To: VAXman- @SendSpamHere.ORG
Injection-Info: gioia.aioe.org; logging-data="37555"; posting-host="pr9o9uw/KLhPSFYv2ok3sg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: VAXm...@SendSpamHere.ORG - Wed, 25 May 2022 13:11 UTC

In article <628d6de1$0$699$14726298@news.sunsite.dk>, =?UTF-8?Q?Arne_Vajh=c3=b8j?= <arne@vajhoej.dk> writes:
>On 5/23/2022 10:54 PM, Jake Hamby wrote:
>> I've been working on updating the open source Regina Rexx interpreter
>> to revive the native support it has for VMS, and I have a question
>> about how best to create a mailbox/pipe for sending multiple DCL
>> commands to a spawned subprocess via SYS$INPUT.
>>
>> Regina tries to execute anything it doesn't recognize as a system
>> command. I've adapted the UNIX version of the code, which uses
>> fork()/exec*(), to instead use vfork(). That code works fine for .EXE
>> files, but it doesn't work for running arbitrary DCL commands
>> (there's a long "vms.rexx" test script that I'm trying to run that's
>> filled with them), so I had to revive some code in the Regina port to
>> use lib$spawn() instead. Here's my latest version of the relevant
>> file, after I removed several functions to create input and output
>> mailboxes:
>>
>> https://github.com/jhamby/vms-regina/blob/jhamby/vms-fixes/vmscmd.c
>>
>> I created a short AST to call on subprocess completion that closes
>> the output stream, if it's redirected, after writing an EOF to it,
>> which I discovered was necessary in order for the UNIX poll()-based
>> code that feeds inputs and outputs into Regina to work. Otherwise it
>> didn't receive any output from the DCL command. So that takes care of
>> the output (it'd be nice if I could set SYS$ERROR separately from
>> SYS$OUTPUT, but it's not a big deal).
>>
>> The problem I have now is that, on the input side, calling getname()
>> to get the mailbox name of a created pipe() to pass as SYS$INPUT in
>> my lib$spawn() call works for one command, but not when I try to send
>> multiple "\n" separated commands. I have the DECC$ feature flags set
>> to enable stream-oriented pipes without carriage control, and I
>> suspect that carriage control is part of the problem, because the
>> error output I'm getting from DCL is the same as if the two lines of
>> DCL commands were jammed together with no separation.
>>
>> But I've tried disabling DECC$STREAM_PIPE and
>> DECC$POPEN_NO_CRLF_REC_ATTR, which were both enabled, and that didn't
>> make any difference. I've tried "\r\n" instead of "\n", but I suspect
>> that I need to do something else as well, perhaps writing each line
>> using a separate write() call?
>>
>> What would be the best way for me to set up a pipe to use for the
>> subprocess's input that I can use to send multiple lines to DCL from
>> my code? Is it possible to use pipe() like I'm doing now, or do I
>> have to call $crembx() myself in order to create a non-stream
>> mailbox? Once I've created the mailbox, what's the recommended
>> strategy for writing individual lines (from C)?
>>
>> Additional detail: where I'm stuck in the vms.rexx test script is
>> that it's sending multiple commands via redirected SYS$INPUT with the
>> DCL command "set def nl:" The Rexx command, with redirection, looks
>> like:
>>
>> 'LIFO> set def nl: >FIFO'
>>
>> I can feed one additional DCL command via SYS$INPUT from the Rexx
>> queue, but no more. I assume that since the test script did work at
>> some point in the distant past, that this must be a valid way to send
>> multiple commands to DCL, so I'm hoping that the only detail that I'm
>> missing is how to set up and write to a pipe in the proper VMS style
>> so that DCL will accept and recognize separate lines of input. Right
>> now I'm getting a DCL error that's the same as if the two lines had
>> been concatenated together with no newline separator ("%DCL-W-UNDSYM,
>> undefined symbol - check validity and spelling \SYS$OUTPUT\").
>>
>> Any suggestions would save me a great deal of trial and error. I've
>> been trying to learn as *little* as possible about VMS
>> record-oriented mailboxes, but I think this is one case where the
>> UNIX stream style won't work. Thanks in advance!
>
>I don't have an explanation for your specific problem.
>
>But my experience is that LIB$SPANW is problematic for general
>DCL commands - it is much better to create a pseudo terminal
>(ptd$ functions).

LIB$SPAWN isn't a problem. I outlined what he needs to do to issue more
than one command. However, those commands are executed in a sub-process,
not in the main/master process. The results of many of the DCL commands
may leave this fellow scratching his head because he doesn't understand
the process/sub-process relationship.

Pseudo-terminals, in this case, will suffer the same afflictions. To do
it right, the commands should execute in the process but that can not be
while his Rexx interpreter is executing.

Many years ago there was a company (Argent, IIRC) that sold a DCL debug-
ger. It was written in C and read a .COM file passing its commands on
to LIB$SPAWN. Context wrong and many lexicals return results that were
sub-process based, not the main/master process. Then I wrote my debug-
ger, the debugger control process is a separate process and the DCL, in
a command procedure or and the command prompt, executes in the process
where they are issued. The debugger process, communicates the DCL, the
command interpeter running in Supervisor mode. Everything you'd expect
the commands to do are done correctly because they're running within the
process context of issue. If you're going to do it, do it right! ;)

Neither of your suggestions will work for something like this:

$ REXX my-rexx-script
blah
blah
blah
do_DCL (XYZZY=="It's magic!")
blah
blah
blah
exit/quit/end/whatever-terminates-REXX
$ SHOW SYMBOL XYZZY
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
$

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

I speak to machines with the voice of humanity.

Re: How to send multiple commands to a DCL subprocess?

<628ec23e$0$704$14726298@news.sunsite.dk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22969&group=comp.os.vms#22969

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Wed, 25 May 2022 19:56:45 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Subject: Re: How to send multiple commands to a DCL subprocess?
Content-Language: en-US
Newsgroups: comp.os.vms
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk>
<00B7539F.E8A0F79C@SendSpamHere.ORG>
From: arn...@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <00B7539F.E8A0F79C@SendSpamHere.ORG>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 30
Message-ID: <628ec23e$0$704$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: a81afce9.news.sunsite.dk
X-Trace: 1653523006 news.sunsite.dk 704 arne@vajhoej.dk/68.9.63.232:52678
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Wed, 25 May 2022 23:56 UTC

On 5/25/2022 9:11 AM, VAXman-@SendSpamHere.ORG wrote:
> In article <628d6de1$0$699$14726298@news.sunsite.dk>, =?UTF-8?Q?Arne_Vajh=c3=b8j?= <arne@vajhoej.dk> writes:
>> I don't have an explanation for your specific problem.
>>
>> But my experience is that LIB$SPANW is problematic for general
>> DCL commands - it is much better to create a pseudo terminal
>> (ptd$ functions).
>
> LIB$SPAWN isn't a problem.

It can be if the commands require a real terminal.

> I outlined what he needs to do to issue more
> than one command. However, those commands are executed in a sub-process,
> not in the main/master process. The results of many of the DCL commands
> may leave this fellow scratching his head because he doesn't understand
> the process/sub-process relationship.
>
> Pseudo-terminals, in this case, will suffer the same afflictions. To do
> it right, the commands should execute in the process but that can not be
> while his Rexx interpreter is executing.

Whatever DCL is done should be considered its own context and
symbols etc. only available for other DCL commands executed
in that context.

It is a restriction, but the feature may still be useful.

Arne

Re: How to send multiple commands to a DCL subprocess?

<6efc7f04-2551-4056-bf1a-51c32d22ec41n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22971&group=comp.os.vms#22971

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a37:a4c2:0:b0:6a3:4299:ba69 with SMTP id n185-20020a37a4c2000000b006a34299ba69mr20926210qke.493.1653527571269;
Wed, 25 May 2022 18:12:51 -0700 (PDT)
X-Received: by 2002:a05:620a:2782:b0:6a4:932f:f9c6 with SMTP id
g2-20020a05620a278200b006a4932ff9c6mr9197724qkp.739.1653527571068; Wed, 25
May 2022 18:12:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 25 May 2022 18:12:50 -0700 (PDT)
In-Reply-To: <00B7539F.E8A0F79C@SendSpamHere.ORG>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:710e:96e9:d8f0:22ab;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:710e:96e9:d8f0:22ab
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk> <00B7539F.E8A0F79C@SendSpamHere.ORG>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6efc7f04-2551-4056-bf1a-51c32d22ec41n@googlegroups.com>
Subject: Re: How to send multiple commands to a DCL subprocess?
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Thu, 26 May 2022 01:12:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3537
 by: Jake Hamby - Thu, 26 May 2022 01:12 UTC

On Wednesday, May 25, 2022 at 7:12:59 AM UTC-7, VAXman- wrote:
> LIB$SPAWN isn't a problem. I outlined what he needs to do to issue more
> than one command. However, those commands are executed in a sub-process,
> not in the main/master process. The results of many of the DCL commands
> may leave this fellow scratching his head because he doesn't understand
> the process/sub-process relationship.
>
> Pseudo-terminals, in this case, will suffer the same afflictions. To do
> it right, the commands should execute in the process but that can not be
> while his Rexx interpreter is executing.

I think that what you suggested will probably work for me. I'll test it out tonight. I actually *do* want to run the commands in a subprocess and not in the main process to have a permanent effect.

The reason is that what the large vms.rexx test script does is issue many DCL commands, mostly SHOW, in a subprocess, in order to compare the results that DCL prints to SYS$OUTPUT on the running system to the results of its own implementations of the major F$ lexical functions. So the commands are intended to have no permanent effects and are only being run for their outputs. Issuing multiple commands at once is more a case of laziness on the script author that I wanted to support.

You make an excellent point that calling DCL commands from Rexx isn't going to be the same as running a DCL script, and that lack of functionality is definitely a weakness of the current set of VMS-specific functions implemented by the previous coders to work on Regina. The only "set" function is F$SETPRV(), but, as you know better than I, the F$ lexicals aren't the way you define symbols and logicals from DCL, and therefore there is no way to do that from Regina right now.

This was at the back of my mind, but your comments have got me to realize that it'd be a good idea for me to add LIB$GET_LOGICAL(), LIB$SET_LOGICAL(), LIB$GET_SYMBOL(), and LIB$SET_SYMBOL() functions to Regina to match the RTL functions. That should fill the feature gap nicely, and I won't have to come up with my own API.

Thanks for the suggestions!

Re: How to send multiple commands to a DCL subprocess?

<0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22972&group=comp.os.vms#22972

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:4ee6:0:b0:462:6af5:dcfc with SMTP id dv6-20020ad44ee6000000b004626af5dcfcmr1240196qvb.22.1653528617632;
Wed, 25 May 2022 18:30:17 -0700 (PDT)
X-Received: by 2002:ac8:5910:0:b0:2f9:b9bd:92b2 with SMTP id
16-20020ac85910000000b002f9b9bd92b2mr7210449qty.191.1653528617444; Wed, 25
May 2022 18:30:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 25 May 2022 18:30:17 -0700 (PDT)
In-Reply-To: <00B7539F.E8A0F79C@SendSpamHere.ORG>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:710e:96e9:d8f0:22ab;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:710e:96e9:d8f0:22ab
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk> <00B7539F.E8A0F79C@SendSpamHere.ORG>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com>
Subject: Re: How to send multiple commands to a DCL subprocess?
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Thu, 26 May 2022 01:30:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2646
 by: Jake Hamby - Thu, 26 May 2022 01:30 UTC

On Wednesday, May 25, 2022 at 7:12:59 AM UTC-7, VAXman- wrote:
>
> Neither of your suggestions will work for something like this:
>
> $ REXX my-rexx-script
> blah
> blah
> blah
> do_DCL (XYZZY=="It's magic!")
> blah
> blah
> blah
> exit/quit/end/whatever-terminates-REXX
> $ SHOW SYMBOL XYZZY
> %DCL-W-UNDSYM, undefined symbol - check validity and spelling

As I wrote in my other post, that's not what I was trying to get working, but the fact that you jumped to that use case reminded me that Regina *is* currently missing a way to get/set VMS symbols and logicals, likely because the previous authors spent their time writing implementations of the F$ lexicals and didn't get around to anything else.

I'll probably add four new builtin functions for VMS like:

SET_SYMBOL("XYZZY", "It's magic!", "LOCAL")
answer = GET_SYMBOL("MEANING_OF_LIFE")
SET_LOGICAL("LOG123", full_drive_name, "CONCEALED")
gamedir = GET_LOGICAL("GAMEDIR")

I'll have to think a bit about the API, but I'm pretty sure that having an optional third argument to set LOCAL vs. GLOBAL and for /TRANS=CONCEALED logicals should be sufficient to cover the use cases. Rexx, like DCL, is very string-oriented, and it supports functions that take a variable number of arguments.

Jake

Re: How to send multiple commands to a DCL subprocess?

<52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22981&group=comp.os.vms#22981

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:4c0e:0:b0:463:8e94:7bf1 with SMTP id bz14-20020ad44c0e000000b004638e947bf1mr1729668qvb.88.1653597296752;
Thu, 26 May 2022 13:34:56 -0700 (PDT)
X-Received: by 2002:a05:622a:104c:b0:2fc:4d41:386 with SMTP id
f12-20020a05622a104c00b002fc4d410386mr3780234qte.293.1653597296547; Thu, 26
May 2022 13:34:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 26 May 2022 13:34:54 -0700 (PDT)
In-Reply-To: <0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:710e:96e9:d8f0:22ab;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:710e:96e9:d8f0:22ab
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk> <00B7539F.E8A0F79C@SendSpamHere.ORG>
<0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
Subject: Re: How to send multiple commands to a DCL subprocess?
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Thu, 26 May 2022 20:34:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4023
 by: Jake Hamby - Thu, 26 May 2022 20:34 UTC

On Wednesday, May 25, 2022 at 6:30:18 PM UTC-7, Jake Hamby wrote:
>
> I'll probably add four new builtin functions for VMS like:
>
> SET_SYMBOL("XYZZY", "It's magic!", "LOCAL")
> answer = GET_SYMBOL("MEANING_OF_LIFE")
> SET_LOGICAL("LOG123", full_drive_name, "CONCEALED")
> gamedir = GET_LOGICAL("GAMEDIR")

Following up: I wasn't able to successfully feed multiple DCL commands as input on a pipe after executing an original dummy command, so I decided to keep everything the way it was (although my extra EOF write to the output pipe turned out to be unnecessary; I only needed to hold the FD open and close it on subprocess exit to write the EOF), because I don't want to hurt the performance of using the LIFO and FIFO redirection features of Regina for streaming data to/from UNIX subprocesses.

Also, it was very easy for me to change a few lines in the "vms.rexx" test script to execute the DCL commands one at a time, instead of pushing them on a stack and feeding them all at once into a single DCL subprocess (although it would've been faster to execute if I could've gotten that to work easily).

BTW, Rexx is blindingly fast compared to DCL on an old VAX. I can get over 700,000 REXX clauses per second on the 667 MHz Alpha, which is plenty for any script I could possibly write, while I recently found an old Hunter Goatley article that I recently posted to his website, showing how he wrote a MACRO program to replace his LOGIN.COM script to save a few clock cycles by calling LIB$SET_SYMBOL() and LIB$SET_LOGICAL() and setting key definitions directly. It's hard to put myself in the frame of mind to where it'd be worth assembling and linking a new version of a LOGIN.EXE to save a few cycles parsing my LOGIN.COM.

https://hunter.goatley.com/vax-professional-articles/vax-pro-08/

In that same spirit, I'd hope to avoid having to call DCL in order for Rexx to do anything it could do for itself. Sadly, there are a few gaps that I don't know how to accomplish from VMS documented APIs (and neither could the previous authors):

F$ENVIRONMENT()
F$VERIFY()
F$GETQUI("DISPLAY_FILE", "FILE_DEVICE", ...)
F$GETQUI("DISPLAY_FILE", "FILE_DID", ...)
F$GETSYI() for "FREE_PAGES", "MODIFIED_PAGES", "NPAGED_*", "PAGED_*", "TOTAL_PAGES", "USED_PAGES"

I'm also curious if the "STORED_SEMANTICS" file attribute is worth supporting in F$FILE_ATTRIBUTES(). What programs ever used the "compound document stored semantics" feature? Is it obsolete now, like the VAX vector processor-related items?

Regards,
Jake

Re: How to send multiple commands to a DCL subprocess?

<bb8a3480-6593-47c1-8cbc-f9edf9f3b701n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22982&group=comp.os.vms#22982

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:15:b0:2f3:cd8f:2a78 with SMTP id x21-20020a05622a001500b002f3cd8f2a78mr30338314qtw.43.1653597437948;
Thu, 26 May 2022 13:37:17 -0700 (PDT)
X-Received: by 2002:a05:620a:2782:b0:6a4:932f:f9c6 with SMTP id
g2-20020a05620a278200b006a4932ff9c6mr12236705qkp.739.1653597437778; Thu, 26
May 2022 13:37:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 26 May 2022 13:37:17 -0700 (PDT)
In-Reply-To: <52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:710e:96e9:d8f0:22ab;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:710e:96e9:d8f0:22ab
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk> <00B7539F.E8A0F79C@SendSpamHere.ORG>
<0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com> <52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bb8a3480-6593-47c1-8cbc-f9edf9f3b701n@googlegroups.com>
Subject: Re: How to send multiple commands to a DCL subprocess?
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Thu, 26 May 2022 20:37:17 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1721
 by: Jake Hamby - Thu, 26 May 2022 20:37 UTC

On Thursday, May 26, 2022 at 1:34:58 PM UTC-7, Jake Hamby wrote:
> while I recently found an old Hunter Goatley article that I recently posted to his website

to avoid any possible confusion, I meant to write that I recently found an article that he recently posted to his website. I don't run Hunter Goatley's website. :)

Re: How to send multiple commands to a DCL subprocess?

<62902a38$0$707$14726298@news.sunsite.dk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22988&group=comp.os.vms#22988

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.swapon.de!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Thu, 26 May 2022 21:32:36 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Subject: Re: How to send multiple commands to a DCL subprocess?
Content-Language: en-US
Newsgroups: comp.os.vms
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk>
<00B7539F.E8A0F79C@SendSpamHere.ORG>
<0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com>
<52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
From: arn...@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 32
Message-ID: <62902a38$0$707$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: f53b9f59.news.sunsite.dk
X-Trace: 1653615160 news.sunsite.dk 707 arne@vajhoej.dk/68.9.63.232:58184
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Fri, 27 May 2022 01:32 UTC

On 5/26/2022 4:34 PM, Jake Hamby wrote:
> In that same spirit, I'd hope to avoid having to call DCL in order
> for Rexx to do anything it could do for itself. Sadly, there are a
> few gaps that I don't know how to accomplish from VMS documented APIs
> (and neither could the previous authors):
> F$ENVIRONMENT()

Some items would not be applicable for REXX.

"DEFAULT" is easy.

A few items can probably be found in somewhere in P1 or S0 space.

> F$VERIFY()

Not applicable I would say.

> F$GETQUI("DISPLAY_FILE", "FILE_DEVICE", ...)
> F$GETQUI("DISPLAY_FILE", "FILE_DID", ...)

SYS$GETQUIW with QUI$DISPLAY_FILE and QUI$_FILE_SPECIFICATION and
then some RMS calls should be able to get that.

> F$GETSYI() for "FREE_PAGES", "MODIFIED_PAGES", "NPAGED_*", "PAGED_*", "TOTAL_PAGES", "USED_PAGES"

"TOTAL_PAGES" should be SYI$_MEMSIZE

but the rest indeed look missing.

Arne

Re: How to send multiple commands to a DCL subprocess?

<t6pb51$d2g$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22989&group=comp.os.vms#22989

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: craigbe...@nospam.mac.com (Craig A. Berry)
Newsgroups: comp.os.vms
Subject: Re: How to send multiple commands to a DCL subprocess?
Date: Thu, 26 May 2022 20:56:48 -0500
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <t6pb51$d2g$1@dont-email.me>
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk>
<00B7539F.E8A0F79C@SendSpamHere.ORG>
<0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com>
<52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 27 May 2022 01:56:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d02e64412d8bc02ae992b1798b7468fe";
logging-data="13392"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DfcYROa8yHQJvbZQ13gaT5bQdYPmHRX8="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.1
Cancel-Lock: sha1:N/FbwEF7lKAcPxJS7y6akF0DcIs=
In-Reply-To: <52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
Content-Language: en-US
 by: Craig A. Berry - Fri, 27 May 2022 01:56 UTC

On 5/26/22 3:34 PM, Jake Hamby wrote:

> In that same spirit, I'd hope to avoid having to call DCL in order
> for Rexx to do anything it could do for itself. Sadly, there are a few gaps
> that I don't know how to accomplish from VMS documented APIs (and
> neither could the previous authors):
>
> F$ENVIRONMENT()
> F$VERIFY()

What could it possibly mean to set the DCL command environment or to set
or get the DCL command verification bit without running DCL?

> F$GETQUI("DISPLAY_FILE", "FILE_DEVICE", ...)
> F$GETQUI("DISPLAY_FILE", "FILE_DID", ...)
> F$GETSYI() for "FREE_PAGES", "MODIFIED_PAGES", "NPAGED_*", "PAGED_*", "TOTAL_PAGES", "USED_PAGES"

So the problem is not with the service calls but just these particular
item codes? They don't look like documented item codes, so either the
DCL lexical functions are using undocumented item codes, or are
performing some additional computation and/or operation on returned
values. I've never done it but my guess would be that the page count
stuff involves computations derived by working from intimate knowledge
of VMS memory handling and internal nomenclature. The computations
*might* be in the ISDM, but that's just a guess as it's a book I've
never had access to. The queue stuff is probably just calling
SYS$GETQUI with QUI$_DISPLAY_FILE and QUI$_FILE_SPECIFCATION and then
parsing the returned file spec to get the DID and DEVICE.

Re: How to send multiple commands to a DCL subprocess?

<b3e77149-7909-4de3-84e4-9734268f0e13n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=22990&group=comp.os.vms#22990

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a37:6650:0:b0:6a3:5fb9:7ff7 with SMTP id a77-20020a376650000000b006a35fb97ff7mr20309382qkc.90.1653623919474;
Thu, 26 May 2022 20:58:39 -0700 (PDT)
X-Received: by 2002:a05:622a:1903:b0:2f3:ddac:436d with SMTP id
w3-20020a05622a190300b002f3ddac436dmr30971405qtc.25.1653623919284; Thu, 26
May 2022 20:58:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 26 May 2022 20:58:38 -0700 (PDT)
In-Reply-To: <t6pb51$d2g$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:bf41:7cb3:ee84:a97f;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:bf41:7cb3:ee84:a97f
References: <0e1b38a1-fdc0-4ac3-b6f7-acfa2198dbc1n@googlegroups.com>
<628d6de1$0$699$14726298@news.sunsite.dk> <00B7539F.E8A0F79C@SendSpamHere.ORG>
<0c49de0d-3542-4c41-adc1-4b65176b0c33n@googlegroups.com> <52424d71-a8fd-4ae1-b1c9-3cf3286083d8n@googlegroups.com>
<t6pb51$d2g$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b3e77149-7909-4de3-84e4-9734268f0e13n@googlegroups.com>
Subject: Re: How to send multiple commands to a DCL subprocess?
From: jake.ha...@gmail.com (Jake Hamby)
Injection-Date: Fri, 27 May 2022 03:58:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3278
 by: Jake Hamby - Fri, 27 May 2022 03:58 UTC

On Thursday, May 26, 2022 at 6:56:53 PM UTC-7, Craig A. Berry wrote:
> On 5/26/22 3:34 PM, Jake Hamby wrote:
>
> >
> > F$ENVIRONMENT()
> > F$VERIFY()
> What could it possibly mean to set the DCL command environment or to set
> or get the DCL command verification bit without running DCL?

Right, that's why I'm not going to bother to implement them. I just mentioned them for completeness because the previous author had an F$VERIFY command in the built-ins list, commented out. Makes no sense for Rexx, you're right.

> > F$GETQUI("DISPLAY_FILE", "FILE_DEVICE", ...)
> > F$GETQUI("DISPLAY_FILE", "FILE_DID", ...)
> > F$GETSYI() for "FREE_PAGES", "MODIFIED_PAGES", "NPAGED_*", "PAGED_*", "TOTAL_PAGES", "USED_PAGES"
> So the problem is not with the service calls but just these particular
> item codes? They don't look like documented item codes, so either the
> DCL lexical functions are using undocumented item codes, or are
> performing some additional computation and/or operation on returned
> values. I've never done it but my guess would be that the page count
> stuff involves computations derived by working from intimate knowledge
> of VMS memory handling and internal nomenclature. The computations
> *might* be in the ISDM, but that's just a guess as it's a book I've
> never had access to. The queue stuff is probably just calling
> SYS$GETQUI with QUI$_DISPLAY_FILE and QUI$_FILE_SPECIFCATION and then
> parsing the returned file spec to get the DID and DEVICE.

Yeah, it's just a few particular item codes that the previous author didn't implement, that I only mention out of completeness.

I discovered a few interesting undocumented codes, like F$GETDVI(device, "SSD_LIFE_REMAINING") and "SSD_USAGE_REMAINING". They both return -1 for me, but I thought I'd add them to the list, just in case they work somewhere.

Jake

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor