<?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: Scripting ANA/SYS in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058635#M85276</link>
    <description>John,&lt;BR /&gt;&lt;BR /&gt;Just talked to HP and what I'm seeing is info about the TCPIP subsystem which gets loaded and displayed the first time the cmd is used.&lt;BR /&gt;&lt;BR /&gt;Any thoughts on how to modify your script to work around this?&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
    <pubDate>Wed, 18 Jul 2007 11:06:58 GMT</pubDate>
    <dc:creator>Jack Trachtman</dc:creator>
    <dc:date>2007-07-18T11:06:58Z</dc:date>
    <item>
      <title>Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058628#M85269</link>
      <description>I would like to use ANA/SYS in a script as follows&lt;BR /&gt;&lt;BR /&gt;1) Create a one line cmd for ANA/SYS (for example, TCPIP SHOW DEV TNA6/FULL)&lt;BR /&gt;&lt;BR /&gt;2) Using PIPE (preferable to using intermediate files), pass the above cmd to ANA/SYS then scan the output to extract the field of interest.&lt;BR /&gt;&lt;BR /&gt;Can anyone point me to examples of scripting ANA/SYS?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 17 Jul 2007 13:09:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058628#M85269</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2007-07-17T13:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058629#M85270</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;do you mean something like:&lt;BR /&gt;&lt;BR /&gt;$ pipe -&lt;BR /&gt;write sys$output "tcpip sh dev tna6/full" -&lt;BR /&gt;| ana/Sys | search sys$input &lt;DATA of="" interest=""&gt; -&lt;BR /&gt;(read sys$input tmp ; ass/job &amp;amp;tmp data)&lt;BR /&gt;$ data=f$trnlnm("DATA")&lt;BR /&gt;$...&lt;BR /&gt;&lt;BR /&gt;regards Kalle&lt;/DATA&gt;</description>
      <pubDate>Tue, 17 Jul 2007 13:31:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058629#M85270</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2007-07-17T13:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058630#M85271</link>
      <description>Oops,&lt;BR /&gt;the example misses a vertical bar before the '(read'.&lt;BR /&gt;&lt;BR /&gt;regards Kalle</description>
      <pubDate>Tue, 17 Jul 2007 13:33:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058630#M85271</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2007-07-17T13:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058631#M85272</link>
      <description>What data might you be looking for within the TNA6: UCB and related structures?  If it's what I think you're looking for, I think somebody already wrote a tool to pull the port details out more directly -- dig around for telnet and accpornam out in c.o.v. or such.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Jul 2007 14:19:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058631#M85272</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-07-17T14:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058632#M85273</link>
      <description>Karl,&lt;BR /&gt;&lt;BR /&gt;I know it was misleading, but the TCPIP cmd I gave as an example is an actual ANA/SYS subcmd (try it!).&lt;BR /&gt;&lt;BR /&gt;Hoff,&lt;BR /&gt;&lt;BR /&gt;It's long story, but in short: the F$GETDVI("TT:", "TT_ACCPORNAM") does return the remote host's IP address and the remote host's IP port #, BUT if the remote host is a VMS host, the port # field is replaced by something called "Location", and I want the port #.&lt;BR /&gt;&lt;BR /&gt;Using ANA/SYS w/the example cmd I gave returns the port #.  I've tried various cmds to get that port #, and ANA/SYS w/the TCPIP cmd seems the best I can find.  If I had some Macro or other language skills, I might try to poke into the system, but I don't have that expertise, so I'm trying to figure out some way to use ANA/SYS within a PIPE (because I hate creating temp files!).</description>
      <pubDate>Tue, 17 Jul 2007 17:27:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058632#M85273</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2007-07-17T17:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058633#M85274</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;  Kalle's example (with correction) works for me. Complete example (assuming you want your own terminal):&lt;BR /&gt;&lt;BR /&gt;$ PIPE WRITE SYS$OUTPUT -&lt;BR /&gt;"tcpip show device/full ",F$TRNLNM("TT")-"_" |-&lt;BR /&gt;ANALYZE/SYSTEM |-&lt;BR /&gt; SEARCH sys$pipe "Port:" | -&lt;BR /&gt; (READ sys$pipe p ; -&lt;BR /&gt;  p=F$ELEMENT(3,":",p) ; -&lt;BR /&gt;  DEFINE/JOB/NOLOG port &amp;amp;p)&lt;BR /&gt;$ SHOW LOG/JOB port&lt;BR /&gt;&lt;BR /&gt;For a more general mechanism for scripting variable input into programs, complex sequences of commands, either place multiple "WRITE SYS$OUTPUT" commands within brackets in the first pipe stage, or execute another command procedure to generate the output lines. (I tend to recurse into myself with p1 as a tag to avoid multiple files). Example for this problem: &lt;BR /&gt;&lt;BR /&gt;$ IF F$EXTRACT(0,5,p1).EQS."STAGE" THEN GOTO 'p1'&lt;BR /&gt;$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))&lt;BR /&gt;$ PIPE @'self' STAGE1 |-&lt;BR /&gt;       @'self' STAGE2 |-&lt;BR /&gt;       @'self' STAGE3 |-&lt;BR /&gt;       @'self' STAGE4&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ STAGE1:&lt;BR /&gt;$ WRITE SYS$OUTPUT "tcpip show device/full "+F$GETDVI(F$TRNLNM("TT"),"DEVNAM")-"_"&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ STAGE2:&lt;BR /&gt;$ DEFINE/USER SYS$INPUT SYS$PIPE:&lt;BR /&gt;$ ANALYZE/SYSTEM&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ STAGE3:&lt;BR /&gt;$ SEARCH SYS$PIPE: "Port:"&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ STAGE4:&lt;BR /&gt;$ READ SYS$PIPE p&lt;BR /&gt;$ p=F$ELEMENT(3,":",p)&lt;BR /&gt;$ DEFINE/JOB/NOLOG port 'p'&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;Notes: &lt;BR /&gt;&lt;BR /&gt;For this case, there are some peculiarities in device and logical names which require F$GETDVI to be used in this context to determine the terminal name, but not from the command line. The leading "_" also needs to be stripped for the SDA extension to recognise the device.&lt;BR /&gt;&lt;BR /&gt;In general, only the complex cases need the self recursion. One liners can be coded directly into the PIPE command. &lt;BR /&gt;&lt;BR /&gt;Testing can be done from the command line by invoking the stages explicitly:&lt;BR /&gt;&lt;BR /&gt;$ PIPE @proc STAGE1 | @proc STAGE2&lt;BR /&gt;&lt;BR /&gt;etc...&lt;BR /&gt;&lt;BR /&gt;It also sometimes makes sense to parameterise the input pipe:&lt;BR /&gt;&lt;BR /&gt;$ PIPE ...&lt;BR /&gt;     @'self' STAGE3 SYS$PIPE: "Port:" | -&lt;BR /&gt;  etc...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ STAGE3:&lt;BR /&gt;$ SEARCH 'p2' "''p3'"&lt;BR /&gt;&lt;BR /&gt;This means the stages can be used to process files, as well as piped input. Thus:&lt;BR /&gt;&lt;BR /&gt;$ PIPE @proc STAGE1 | @proc STAGE2 &amp;gt; check.tmp&lt;BR /&gt;&lt;BR /&gt;$ @proc STAGE3 check.tmp "Port:"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Jul 2007 19:19:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058633#M85274</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-07-17T19:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058634#M85275</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Thanks much for the long answer - it will take me a while to digest all the info!&lt;BR /&gt;&lt;BR /&gt;I tried your example pertinant to my question, and it worked, but...&lt;BR /&gt;&lt;BR /&gt;I now have a question about SDA.  I have reduced your script to show the problem:&lt;BR /&gt;&lt;BR /&gt;$ PIPE WRITE SYS$OUTPUT -&lt;BR /&gt;"tcpip show device/full ",F$TRNLNM("TT")-"_" |-&lt;BR /&gt;ANALYZE/SYSTEM&lt;BR /&gt;&lt;BR /&gt;When I run this I get:&lt;BR /&gt;&lt;BR /&gt;$ PIPE WRITE SYS$OUTPUT -&lt;BR /&gt;"tcpip show device/full ",F$TRNLNM("TT")-"_" |-&lt;BR /&gt;ANALYZE/SYSTEM&lt;BR /&gt;&lt;BR /&gt;OpenVMS (TM) system analyzer&lt;BR /&gt;&lt;BR /&gt;%TCPIP-I-LINKDATE, TCPIP$TNDRIVER linked on 20-APR-2006 18:22:33.17&lt;BR /&gt;%TCPIP-I-LINKDATE, TCPIP$BGDRIVER linked on 24-JUL-2006 15:40:09.29&lt;BR /&gt;%TCPIP-I-LINKDATE, TCPIP$PROXY_SERVICES linked on 18-SEP-2003 22:00:28.99&lt;BR /&gt;%TCPIP-I-LINKDATE, TCPIP$INTERNET_SERVICES linked on 24-JUL-2006 15:40:15.52&lt;BR /&gt;%TCPIP-I-VERSION, TCP/IP Services for OpenVMS Version 4196548608.0&lt;BR /&gt;-TCPIP-W-JUSTINCASE, In case you're curious, this is NOT a valid version of TCPI&lt;BR /&gt;P&lt;BR /&gt;-TCPIP-W-DISCLAIMER, You are proceeding at your own risk!&lt;BR /&gt;%TCPIP-W-NOREAD, unable to access location FFFFFFFF.B4DE0168&lt;BR /&gt;%TCPIP-I-LASTSTART, Driver last started 17-NOV-1858 00:00:00.45&lt;BR /&gt;-TCPIP-I-STARTCOUNT, Driver was started 1 time&lt;BR /&gt;-TCPIP-I-PREVSTART, Previously started at  7-JUN-2007 20:51:34.25&lt;BR /&gt;%TCPIP-W-NOREAD, unable to access location FFFFFFFF.B4DE0264&lt;BR /&gt;%TCPIP-I-TRACEINFO, Trace information is not available&lt;BR /&gt;%TCPIP-E-NOPWIP, Pathworks-over-IP (PWIP) driver is not present&lt;BR /&gt;%TCPIP-E-NONFSSVCS, NFS Services execlet is not present&lt;BR /&gt;%TCPIP-E-NOTBGDEVICE, Not a BG (INET network socket) device&lt;BR /&gt;-TCPIP-E-NOTTNDEVICE, Not a TN (network terminal) device&lt;BR /&gt;$ exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If I run SDA interactively and type in the "TCPIP..." cmd, I first get the above display with a "Press RETURN to continue".  Pressing RETURN gets the screen with the info I need, but yur script causes SDA to exit at the "Press..." prompt.&lt;BR /&gt;&lt;BR /&gt;Just what is SDA doing here &amp;amp; how do I suppress this first screen?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 18 Jul 2007 10:38:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058634#M85275</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2007-07-18T10:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058635#M85276</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Just talked to HP and what I'm seeing is info about the TCPIP subsystem which gets loaded and displayed the first time the cmd is used.&lt;BR /&gt;&lt;BR /&gt;Any thoughts on how to modify your script to work around this?&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Wed, 18 Jul 2007 11:06:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058635#M85276</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2007-07-18T11:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058636#M85277</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;  Any thoughts on how to modify &lt;BR /&gt;&amp;gt;your script to work around this?&lt;BR /&gt;&lt;BR /&gt;  First fix would be to fix the TCPIP mismatch.&lt;BR /&gt;&lt;BR /&gt;  Since I don't see that error, I can't test, but if all you need is a "Press return to continue" you should be able to get around that with:&lt;BR /&gt;&lt;BR /&gt;$ PIPE (WRITE SYS$OUTPUT "" ; -&lt;BR /&gt;        WRITE SYS$OUTPUT -&lt;BR /&gt;"tcpip show device/full ",F$TRNLNM("TT")-"_" ; WRITE SYS$OUTPUT "") |-&lt;BR /&gt;ANALYZE/SYSTEM&lt;BR /&gt;&lt;BR /&gt;The additional CRs should be benign for systems that don't have the TCPIP mismatch, and if you filter the output with SEARCH you should be able to skip all the warnings.&lt;BR /&gt;&lt;BR /&gt;That said, you really should be fixing the underlying mismatch.</description>
      <pubDate>Wed, 18 Jul 2007 19:58:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058636#M85277</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-07-18T19:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058637#M85278</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Sorry to keep dragging this on...&lt;BR /&gt;&lt;BR /&gt;If I copy the cmd shown in your last email, and paste it into a Telnet session, it works.&lt;BR /&gt;&lt;BR /&gt;If I put your cmd into a script and run it,  ANA/SYS exits where it comes to the first prompt of Press RETURN to continue.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?</description>
      <pubDate>Thu, 19 Jul 2007 12:16:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058637#M85278</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2007-07-19T12:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058638#M85279</link>
      <description>Since you're doing this interactively SDA tries to help you out. It determines the page length of your terminal (likely 24) and then pauses to give you a chance to read the display of that many lines and wants you to press return to continue on. You should be able to just insert a "set term/page=255" at the beginning of your piped commands and a "set term/page=24" at the end. Not particularly elegant but it should suffice if your goal is to do this in a single command line.</description>
      <pubDate>Thu, 19 Jul 2007 14:03:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058638#M85279</guid>
      <dc:creator>Jim_McKinney</dc:creator>
      <dc:date>2007-07-19T14:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting ANA/SYS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058639#M85280</link>
      <description>Thanks all.&lt;BR /&gt;&lt;BR /&gt;I've now got some useful ideas.</description>
      <pubDate>Mon, 23 Jul 2007 16:54:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/scripting-ana-sys/m-p/5058639#M85280</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2007-07-23T16:54:26Z</dc:date>
    </item>
  </channel>
</rss>

