<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: help with dcl script in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821327#M37538</link>
    <description>&lt;P&gt;&amp;gt; [...] a script to send the equivalent of&amp;nbsp; pf1 or [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Define "send"?&amp;nbsp; Send how, exactly?&amp;nbsp; Send to what, exactly?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; It might be more helpful to describe the actual problem&lt;BR /&gt;which you are trying to solve than to ask how to implement&lt;BR /&gt;some specfic "solution" to that problem.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; A VT terminal (or equivalent) sends a particular escape&lt;BR /&gt;sequence for each PFx key.&amp;nbsp; A Web search for, say:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vt escape sequence&lt;BR /&gt;or:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pf1 escape sequence&lt;BR /&gt;should find many documents which explain what such terminals&lt;BR /&gt;send when keys like PFx are used.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Generally, a Control/x combination masks off the high two&lt;BR /&gt;or three bits of the usual ASCII code for "x", leaving the&lt;BR /&gt;low five bits.&amp;nbsp; So, for example, Control turns "C", 0x43,&lt;BR /&gt;into ETX, 0x03; or "[", 0x5B, into ESC, 0x1B.&amp;nbsp; (Or "R", 0x52,&lt;BR /&gt;into DC2, 0x12.)&lt;/P&gt;</description>
    <pubDate>Wed, 30 Dec 2015 15:11:01 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2015-12-30T15:11:01Z</dc:date>
    <item>
      <title>help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821313#M37537</link>
      <description>&lt;P&gt;I would like to write a script to send the equivalent of &amp;nbsp;pf1 or pf2 or pf3 or pf4 keys, and a control key+letter (like control key+R).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 13:00:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821313#M37537</guid>
      <dc:creator>sandy test</dc:creator>
      <dc:date>2015-12-30T13:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821327#M37538</link>
      <description>&lt;P&gt;&amp;gt; [...] a script to send the equivalent of&amp;nbsp; pf1 or [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Define "send"?&amp;nbsp; Send how, exactly?&amp;nbsp; Send to what, exactly?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; It might be more helpful to describe the actual problem&lt;BR /&gt;which you are trying to solve than to ask how to implement&lt;BR /&gt;some specfic "solution" to that problem.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; A VT terminal (or equivalent) sends a particular escape&lt;BR /&gt;sequence for each PFx key.&amp;nbsp; A Web search for, say:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vt escape sequence&lt;BR /&gt;or:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pf1 escape sequence&lt;BR /&gt;should find many documents which explain what such terminals&lt;BR /&gt;send when keys like PFx are used.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Generally, a Control/x combination masks off the high two&lt;BR /&gt;or three bits of the usual ASCII code for "x", leaving the&lt;BR /&gt;low five bits.&amp;nbsp; So, for example, Control turns "C", 0x43,&lt;BR /&gt;into ETX, 0x03; or "[", 0x5B, into ESC, 0x1B.&amp;nbsp; (Or "R", 0x52,&lt;BR /&gt;into DC2, 0x12.)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 15:11:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821327#M37538</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-12-30T15:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821332#M37539</link>
      <description>&lt;P&gt;I'm not sure what you mean with "send&amp;nbsp;the equivalent of". You may want to give some details.&lt;/P&gt;&lt;P&gt;For what it is worth, have a look at the VTxxx documentation, for example the&amp;nbsp;VT220 Programmer Reference Manual, which is available at &lt;A href="http://vt100.net/docs/vt220-rm/" target="_blank"&gt;http://vt100.net/docs/vt220-rm/&lt;/A&gt;. Chapter 3 is about Transmitted Codes.&lt;/P&gt;&lt;P&gt;On the DCL side, you can define symbols for non-printable ASCII (and&amp;nbsp;ISO-Latin-1) characters with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ DC2[0,8]=%x12
$ ESC[0,8]=%x1b
$ PF1=ESC+"OP"&lt;/PRE&gt;&lt;P&gt;and then you can use &lt;FONT face="courier new,courier"&gt;WRITE&lt;/FONT&gt; to "send" them to a file, opened by DCL,&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SYS$OUTPUT&lt;/FONT&gt;, ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 15:39:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821332#M37539</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2015-12-30T15:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821339#M37540</link>
      <description>&lt;P&gt;Programmable Function PF keys and many other keyboard keys are just ANSI control sequences. &amp;nbsp;An escape character or a CSI character, and a few other characters, using a specific format. &amp;nbsp; These are then set to whatever device is on the other end of the connection. &amp;nbsp; From the termianl or terminal emulator to the host. &amp;nbsp;There are analogous&amp;nbsp;ANSI control sequences that are sent from the host to the terminal or terminal emulator, causing the output device to use bold text or position the output text or the input cursor somewhere, or such.&lt;/P&gt;&lt;P&gt;These go from host ot device, or device to host.&lt;/P&gt;&lt;P&gt;What this I/O doesn't do is go from a DCL procedure to an application program, which is what I suspect you're looking to do here. &amp;nbsp; DCL output goes to the null device, or to a log file of some sort, or to a user via a terminal or terminal emulator. &amp;nbsp; Input from the user goes from the terminal or terminal emulator to DCL or to the application, depending on what is performing the read I/O request.&lt;/P&gt;&lt;P&gt;What doesn't happen is DCL output to application input. &amp;nbsp; Not under normal circumstances.&lt;/P&gt;&lt;P&gt;Which means you're probably&amp;nbsp;looking to wrap or test or otherwise automate some application program that's probably screen-based, and you now want to have a DCL command procedure or some other application software that you can control to perform the key-pressing and related tasks.&lt;/P&gt;&lt;P&gt;Unfortunately for your quest, OpenVMS and its command language has no analog of the &lt;A href="http://www.linuxjournal.com/article/3065" target="_blank"&gt;bash expect command&lt;/A&gt;, so the usual analogs used here are the use of DECset and its DEC Test Manager package, or the use of an application program and the OpenVMS construct known as a pseudo-terminal and running the application via your own application-controlled terminal device (that's not a DCL API), or reworking the target application to have a callable API. &amp;nbsp;None of which is particularly trivial.&lt;/P&gt;&lt;P&gt;For some related discussions and additional background,, see &lt;A href="https://groups.google.com/d/msg/comp.os.vms/StmK83A5Qus/iD357WWvEwAJ" target="_blank"&gt;here&lt;/A&gt; &lt;A href="https://groups.google.com/d/msg/comp.os.vms/0R3UKMJkrJc/FR6BLm2PiyAJ" target="_blank"&gt;here&lt;/A&gt;&amp;nbsp;&lt;A href="https://groups.google.com/d/msg/comp.os.vms/6O25Nh_9A88/pw9x2yCRvqQJ" target="_blank"&gt;here&lt;/A&gt;&amp;nbsp;or &lt;A href="https://groups.google.com/d/msg/comp.os.vms/sjBHK7lglAg/F_ER1wfLO9sJ" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;If I've guessed wrong here, When asking questions, please provide some additional background to your question. &amp;nbsp; Background and details and examples and/or software versions or related — investing&amp;nbsp;a little time into the question that you're asking — can mean you'll get the answer you need, and much more quickly, too. &amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 18:57:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821339#M37540</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2015-12-30T18:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821374#M37541</link>
      <description>&lt;P&gt;Thanks for all your imput, and yes I should have been more specific.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I am looking for a way to "gently" logoff inactive users. We have been using watcher, but just doing a dcl stop pid causes RDB to do&lt;/P&gt;&lt;P&gt;a recovery, and also bothers our standby database. I also tried the other options which were suggested in the watcher help, but those also caused&lt;/P&gt;&lt;P&gt;problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As all of our users are captured accounts running to same application, I would like to send a series of "pressed keys" to each inactive terminal&lt;/P&gt;&lt;P&gt;to basically do what the actual user does when he logs off from the application. We have a program like "peek and spy" which allows us to connect&lt;/P&gt;&lt;P&gt;to the user's terminal. I thought to write a dcl script to start control on the terminal, and then send a sequence of pf and control keys to logoff&lt;/P&gt;&lt;P&gt;the user. I will consult the links mentioned as see if I can get something that works.&lt;/P&gt;&lt;P&gt;Thanks again for your help and suggestions.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 06:21:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821374#M37541</guid>
      <dc:creator>sandy test</dc:creator>
      <dc:date>2015-12-31T06:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821428#M37542</link>
      <description>&lt;P&gt;Ah, so some details. &amp;nbsp; Okay. &amp;nbsp; As for the "pressed keys" approach, set up a pseudo-terminal or the rest. &amp;nbsp; That's how the "pressed keys" stuff works, irrespective of what you want to do with your key presses. &amp;nbsp; Doesn't do what you want, not easy to deal with,. not particularly applicable here. &amp;nbsp; Same answer as before, in short.&lt;/P&gt;&lt;P&gt;Likely the easiest answer is to switch the tool that you are using over to using &lt;A href="http://h71000.www7.hp.com/doc/84final/4527/4527pro_048.html#jun_266" target="_blank"&gt;$forcex&lt;/A&gt;&amp;nbsp;calls and not $delprc calls, and get on with life. &amp;nbsp; &amp;nbsp;That's a trivial change in most applications, too. &amp;nbsp; The $forcex invokes whatever exit handlers the application has established, and which should allow RMS and Rdb to run their cleanup processing.&lt;/P&gt;&lt;P&gt;The ancient &lt;A href="http://labs.hoffmanlabs.com/vmsfaq/vmsfaq.PDF" target="_blank"&gt;OpenVMS FAQ&lt;/A&gt; has various discussions of idle-process killers other than MadGoat Watcher, too. &amp;nbsp; There's what looks to be an &lt;A href="https://github.com/endlesssoftware/watcher" target="_blank"&gt;updated Watcher version available via Github&lt;/A&gt;, too — if that's not what you're using here.&lt;/P&gt;&lt;P&gt;Tried WATCHER_LOGOUT procedure and a sequence involving a STOP /EXIT=USER /ID=pid or such? &amp;nbsp;Work your way up to an inner-mode exit after a delay, as the user-mode exit can be ignored if the user-mode developer was inclined to code the application to do so. &amp;nbsp; Also within the current Watcher code, I'd very likely extend the delta between the $forcex and the $delprc from the current two seconds to maybe 30 seconds or so, to give Rdb time to do... whatever. &amp;nbsp; You're not in a hurry here, after all. &amp;nbsp; Based on a very quick look at the source, make the following change in force.b32 or whatever replaced it in the version you're using locally:&lt;/P&gt;&lt;P&gt;DELPRCDLY : VECTOR [2,LONG],&lt;/P&gt;&lt;P&gt;goes to&lt;/P&gt;&lt;P&gt;DELPRCDLY : VECTOR [30,LONG],&lt;/P&gt;&lt;P&gt;The best solution is to use timers in the application you're working with. &amp;nbsp;Asynchronous exits and asynchronous process kills have always tended to be problematic, as they can arrive at particularly inopportune moments, even in an idle process. &amp;nbsp; Either have the timer fire within the application, or set up a &lt;A href="http://labs.hoffmanlabs.com/node/492" target="_blank"&gt;doorbell lock&lt;/A&gt; or a mailbox or other interprocess comms to allow you to send an exit request.&lt;/P&gt;&lt;P&gt;As for the general "everybody out of the database" sequence, there's a way to kick everybody out of the database from the Rdb RMU level, too. &amp;nbsp; RMU /CLOSE /ABORT=forcex or some such. &amp;nbsp; I've used that prior to starting up certain maintenance processing.&lt;/P&gt;&lt;P&gt;FWIW, asking specific questions will usually get you the right answer to the question that you are asking, but can entirely entirely miss a better or easier or different solution to the problem you are solving.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 22:31:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821428#M37542</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2015-12-31T22:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: help with dcl script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821516#M37543</link>
      <description>&lt;P&gt;Sandy,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;A different approach.&lt;/P&gt;&lt;P&gt;I find that Idle Process Killers train your users to not logout. After all, why should they bother? Let the machine do it. That just exacerbates the issue.&lt;/P&gt;&lt;P&gt;My suggestion is to train your users the other way. Assuming you have the logic to detect idle processes, instead of attempting to kill the process, with all the headaches that causes, instead send an email to the culprit, reminding them of company policy to not leave open terminals/sessions, and a count of how many times they've been in breach of the policy in the past day/week/month/year. If they exceed some threshold, include a CC to their manager. Offer an incentive, something trivial like movie tickets, for anyone who has a zero breach score over 6 months or a year.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2016 20:31:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/help-with-dcl-script/m-p/6821516#M37543</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2016-01-03T20:31:27Z</dc:date>
    </item>
  </channel>
</rss>

