<?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: Using F$Parse to grab a version number in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062209#M24622</link>
    <description>For a good time, see also a related&lt;BR /&gt;comp.os.vms thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://groups.google.com/group/comp.os.vms/browse_thread/thread/4870fa27fc358aaa/8efd1a993fc1a8f9" target="_blank"&gt;http://groups.google.com/group/comp.os.vms/browse_thread/thread/4870fa27fc358aaa/8efd1a993fc1a8f9&lt;/A&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Aug 2007 22:00:07 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2007-08-08T22:00:07Z</dc:date>
    <item>
      <title>Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062202#M24615</link>
      <description>I thought I understood that F$Parse would return the actual version number of a file.  I want to monitor some log files that keep hitting 32767 versions too fast. :(&lt;BR /&gt;&lt;BR /&gt;An test I just did:&lt;BR /&gt;&lt;BR /&gt;$ dir net$server.log&lt;BR /&gt;&lt;BR /&gt;Directory DISK$ICS:[DYSON]&lt;BR /&gt;&lt;BR /&gt;NET$SERVER.LOG;657  NET$SERVER.LOG;656  &lt;BR /&gt;&lt;BR /&gt;Total of 2 files.&lt;BR /&gt;$ x = f$parse ("NET$SERVER.LOG",,,"VERSION")&lt;BR /&gt;$ sho sym x&lt;BR /&gt;  X = ";"&lt;BR /&gt;&lt;BR /&gt;What am I missing or doing wrong?  I wanted to see the string "657".  The on-line help suggests to me it should:&lt;BR /&gt;&lt;BR /&gt;     field&lt;BR /&gt;&lt;BR /&gt;         Specifies a character string containing the name of a field&lt;BR /&gt;         in a file specification. Specifying the field argument causes&lt;BR /&gt;         the F$PARSE function to return a specific portion of a file&lt;BR /&gt;         specification.&lt;BR /&gt;&lt;BR /&gt;         Specify one of the following field names (do not abbreviate):&lt;BR /&gt;&lt;BR /&gt;         NODE       Node name&lt;BR /&gt;         DEVICE     Device name&lt;BR /&gt;         DIRECTORY  Directory name&lt;BR /&gt;         NAME       File name&lt;BR /&gt;         TYPE       File type&lt;BR /&gt;         VERSION    File version number&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Rick</description>
      <pubDate>Wed, 08 Aug 2007 10:55:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062202#M24615</guid>
      <dc:creator>Rick Dyson</dc:creator>
      <dc:date>2007-08-08T10:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062203#M24616</link>
      <description>Rick,&lt;BR /&gt;&lt;BR /&gt;try a&lt;BR /&gt;&lt;BR /&gt;$ tmp = F$Search("NET$SERVER.LOG;*")&lt;BR /&gt;$ if (tmp.nes."")&lt;BR /&gt;$ then&lt;BR /&gt;$   vers = F$Parse("''Tmp'",,,"version")-";"&lt;BR /&gt;$   if (vers.gt.....)&lt;BR /&gt;$ endif&lt;BR /&gt;&lt;BR /&gt;regards Kalle</description>
      <pubDate>Wed, 08 Aug 2007 11:08:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062203#M24616</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2007-08-08T11:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062204#M24617</link>
      <description>Thank you for the idea Karl.&lt;BR /&gt;&lt;BR /&gt;That will provide me with what I am looking for!  I guess I just am reading the on-line help wrong for the F$Parse.  It see it parses the literal string that is provided and if no version number is provided, it comes up empty.  I read it that it takes the filespec and provides you with the version number (and I assumed unless otherwise specified, the current highest number).  Apparently not. :)&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2007 11:19:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062204#M24617</guid>
      <dc:creator>Rick Dyson</dc:creator>
      <dc:date>2007-08-08T11:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062205#M24618</link>
      <description>I think I just read the on-line help incorrectly.  Using a F$search for any/all files in a loop with the F$parse is apparently the approach that was probably intended.&lt;BR /&gt;&lt;BR /&gt;Rick</description>
      <pubDate>Wed, 08 Aug 2007 11:34:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062205#M24618</guid>
      <dc:creator>Rick Dyson</dc:creator>
      <dc:date>2007-08-08T11:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062206#M24619</link>
      <description>You defaulted the version in your original code, and f$parse indicates that with the ; result.  DCL is working as intended, in other words. &lt;BR /&gt;&lt;BR /&gt;What problem might you be seeking to address here?&lt;BR /&gt;&lt;BR /&gt;If it's renumbering the versions of the NETSERVER log files lower and/or dealing with the impending ;32767 version, there's an easier way, assuming you can quiesce the environment briefly: &lt;A href="http://64.223.189.234/node/456" target="_blank"&gt;http://64.223.189.234/node/456&lt;/A&gt;</description>
      <pubDate>Wed, 08 Aug 2007 12:17:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062206#M24619</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-08-08T12:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062207#M24620</link>
      <description>Hi Hoff,&lt;BR /&gt;&lt;BR /&gt;it is not netserver, per say.  It is actually a problem with Process Software's SSH server.  We are seeing as many as 10's of thousands of SSH connections per day tyring brute force password hacks.  Each attempt opens a SSHD.LOG file.  When the version gets to 32767, it starts doing crazy things, sometimes denying access, other times putting log session contents into data streams that are occurring in the session that does connect, etc.&lt;BR /&gt;&lt;BR /&gt;Netserver (net$server) has caught me in the past, but never over and over again on time scales of a few days.  More like once every few years. :)&lt;BR /&gt;&lt;BR /&gt;I wanted a quick way to monitor the current version number and notify me of it approaching some threshold.&lt;BR /&gt;&lt;BR /&gt;I did not fully grasp the description.  I think I got it now once I saw an example of how Karl suggested using it.</description>
      <pubDate>Wed, 08 Aug 2007 12:29:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062207#M24620</guid>
      <dc:creator>Rick Dyson</dc:creator>
      <dc:date>2007-08-08T12:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062208#M24621</link>
      <description>If you have the option, consider moving ssh off of port 22, and to another port.  This greatly reduces the effects of the brute-force attacks.&lt;BR /&gt;&lt;BR /&gt;I'd definitely ring up Process and see if they can rework sshd some to avoid this situation.&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2007 20:45:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062208#M24621</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-08-08T20:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062209#M24622</link>
      <description>For a good time, see also a related&lt;BR /&gt;comp.os.vms thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://groups.google.com/group/comp.os.vms/browse_thread/thread/4870fa27fc358aaa/8efd1a993fc1a8f9" target="_blank"&gt;http://groups.google.com/group/comp.os.vms/browse_thread/thread/4870fa27fc358aaa/8efd1a993fc1a8f9&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2007 22:00:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062209#M24622</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-08-08T22:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062210#M24623</link>
      <description>As of V8.2 you can use DIRECTORY to find files nearing version limits:&lt;BR /&gt;&lt;BR /&gt;$ DIRECTORY /SELECT=VERSION=MINIMUM=30000 disk:[000000...]*.*;&lt;BR /&gt;&lt;BR /&gt;Once found, assuming a reasonably quiescent system, you can reset the version numbers with:&lt;BR /&gt;&lt;BR /&gt;$ RENAME file.typ;* file.typ_TMP;&lt;BR /&gt;$ RENAME file.typ_TMP; file.typ;&lt;BR /&gt;&lt;BR /&gt;This will take all existing versions of a file and renumber them in the same sequence starting from 1. The trailing semicolon is required.&lt;BR /&gt;&lt;BR /&gt;Here's a procedure either reset a single file, or search for, and reset them:&lt;BR /&gt;&lt;BR /&gt;VERSION_RESET.COM&lt;BR /&gt;$ IF F$EXTRACT(0,1,p1).EQS."#"&lt;BR /&gt;$ THEN&lt;BR /&gt;$   target=p1-"#"&lt;BR /&gt;$   GOTO 'target'&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$&lt;BR /&gt;$ files=F$PARSE(";",p1,"SYS$DISK:[000000...]*.*;")&lt;BR /&gt;$ lim=p2&lt;BR /&gt;$ IF lim.EQS."" THEN lim="30000"&lt;BR /&gt;$ PIPE  DIRECTORY/NOHEAD/NOTRAIL/SELECT=VERSION=MINIMUM='lim' 'files' | -&lt;BR /&gt;        @'F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))' #PROCESS SYS$PIPE&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ PROCESS:&lt;BR /&gt;$ IF p2.EQS."" THEN p2="SYS$PIPE"&lt;BR /&gt;$ OPEN/READ in 'p2'&lt;BR /&gt;$ loop: READ/END=EndLoop in line&lt;BR /&gt;$   @'F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))' #RESET 'line'&lt;BR /&gt;$ GOTO loop&lt;BR /&gt;$ EndLoop: CLOSE in&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ RESET:&lt;BR /&gt;$   typ=".$"&lt;BR /&gt;$   IF F$PARSE(p2,,,"TYPE").EQS.typ THEN typ=".Z"&lt;BR /&gt;$   RENAME 'F$PARSE(";*",p2)'     'F$PARSE(";",typ,p2)'&lt;BR /&gt;$   RENAME 'F$PARSE(";*",typ,p2)' 'F$PARSE(";",p2)'&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;usage:&lt;BR /&gt;&lt;BR /&gt;to search for and reset multiple files&lt;BR /&gt;&lt;BR /&gt;$ @VERSION_RESET filespec [minimum-version]&lt;BR /&gt;&lt;BR /&gt;or for a single file&lt;BR /&gt;&lt;BR /&gt;$ @VERSION_RESET #RESET filespec&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2007 23:56:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062210#M24623</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-08-08T23:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062211#M24624</link>
      <description>Rick,&lt;BR /&gt;     If you want a 'one-liner', try&lt;BR /&gt;&lt;BR /&gt;$ X = $f$elem(1,";",f$search("NET$SERVER.LOG",))&lt;BR /&gt;&lt;BR /&gt;Dave</description>
      <pubDate>Thu, 09 Aug 2007 07:08:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062211#M24624</guid>
      <dc:creator>The Brit</dc:creator>
      <dc:date>2007-08-09T07:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062212#M24625</link>
      <description>re: &lt;BR /&gt;&lt;BR /&gt;f$elem(1,";",f$search("NET$SERVER.LOG",))&lt;BR /&gt;&lt;BR /&gt;I'd suggest: &lt;BR /&gt;&lt;BR /&gt;f$parse(f$search("LOGIN.COM"),,,"VERSION")&lt;BR /&gt;&lt;BR /&gt;Shopping for characters in filenames -- embedding syntax -- caused problems for applications moving to ODS-5.  &lt;BR /&gt;&lt;BR /&gt;Dave's suggested DCL will tip over with more than semicolon in a filename, something which is quite legal in an ODS-5 filename.  (You do have to escape it, but the f$element technique doesn't catch the escapement.)&lt;BR /&gt;&lt;BR /&gt;The engineer that coded up PCSI made that same basic local-parsing mistake, and the PCSI filename-parsing code mis-parses a number of valid file names when last I checked.  There was a bug report, FWIW.&lt;BR /&gt;&lt;BR /&gt;"Filename Parsing: Don't Try This At Home"&lt;BR /&gt;&lt;A href="http://10.1.2.7/node/71" target="_blank"&gt;http://10.1.2.7/node/71&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Aug 2007 09:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062212#M24625</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-08-09T09:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using F$Parse to grab a version number</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062213#M24626</link>
      <description>&amp;gt; "Filename Parsing: Don't Try This At Home"&lt;BR /&gt;&amp;gt; &lt;A href="http://10.1.2.7/node/71" target="_blank"&gt;http://10.1.2.7/node/71&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;10.1.2.7?  Don't try it anywhere else.</description>
      <pubDate>Thu, 09 Aug 2007 09:59:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-f-parse-to-grab-a-version-number/m-p/5062213#M24626</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-08-09T09:59:33Z</dc:date>
    </item>
  </channel>
</rss>

