<?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: How to get the NUmber of lines in a file into a variable in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454948#M31738</link>
    <description>&lt;BR /&gt;What would happen if a file was coming in during the run? It would be locked no, and give 0 records. &lt;BR /&gt;&lt;BR /&gt;You carefully parse out file names and version numbers, but then search 'the latest' version from a simple name in the current default directory. Ooops!&lt;BR /&gt;Surely that is due to using the context from a prior scripts.&lt;BR /&gt;&lt;BR /&gt;Moreover, please consider replacing the convoluted DIR/OUT with temp file work with F$SEARCH and F$PARSE solution. Once you get the hang of that you'll never look back to parsing file names.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 12 Jan 2005 09:45:03 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2005-01-12T09:45:03Z</dc:date>
    <item>
      <title>How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454926#M31716</link>
      <description>I want to get the number of lines in a file into a variable. I do get the number of lines in a files using this command &lt;BR /&gt;sear &lt;FILENAME&gt; "" /log /nooutput. &lt;BR /&gt;But I have trouble assigning this output to a variable. In Unix I do wc -l &lt;FILENAME&gt;. Any help is greatly appreciated.&lt;BR /&gt;Prem.&lt;/FILENAME&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 04 Jan 2005 09:25:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454926#M31716</guid>
      <dc:creator>Prem Mohan</dc:creator>
      <dc:date>2005-01-04T09:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454927#M31717</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You might try the lexical function F$FILE_ATTRIBUTES, with FILE_LENGTH_HINT as item-code. Something like:&lt;BR /&gt;$ flh = f$file_attributes("TEST.TXT","FILE_LENGTH_HINT")&lt;BR /&gt;$ show symbol flh&lt;BR /&gt;See also HELP LEXICALS F$FILE_ATTRIBUTES&lt;BR /&gt;&lt;BR /&gt;Greetz,&lt;BR /&gt;&lt;BR /&gt;Kris (aka Qkcl)&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jan 2005 09:53:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454927#M31717</guid>
      <dc:creator>Kris Clippeleyr</dc:creator>
      <dc:date>2005-01-04T09:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454928#M31718</link>
      <description>Prem,&lt;BR /&gt;&lt;BR /&gt;you can also achiev this via PIPE (see examples in OpenVMS FAQ):&lt;BR /&gt;&lt;BR /&gt;$ pipe search login.com ""/log/noout| ( read sys$input line ; wc = F$ELEMENT(3," ",line) ; define/job wc &amp;amp;wc)&lt;BR /&gt;$ x=F$TRNLNM("wc")&lt;BR /&gt;$ sho sym x&lt;BR /&gt;  X = "79"&lt;BR /&gt;$ DEASS/JOB wc&lt;BR /&gt;&lt;BR /&gt;FILE_LENGTH_HINT only works on ODS-5 volumes !&lt;BR /&gt;&lt;BR /&gt;$ write sys$output f$file_attributes("login.com","file_length_hint")&lt;BR /&gt;(-1,-1)&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 04 Jan 2005 10:08:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454928#M31718</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2005-01-04T10:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454929#M31719</link>
      <description>The new way is to use the PIPE command:&lt;BR /&gt;&lt;BR /&gt;$ pipe sear/noout/stat &lt;YOUR file="" here=""&gt; "" | sear sys$pipe "Records sear" | ( read sys$pipe line ; num = f$ele(2," ",f$edi(line,"compress")) ; def/job numl &amp;amp;num )&lt;BR /&gt;$ numl = f$trn("numl")&lt;BR /&gt;$ sho sym numl&lt;BR /&gt;&lt;BR /&gt;Ken&lt;/YOUR&gt;</description>
      <pubDate>Tue, 04 Jan 2005 10:10:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454929#M31719</guid>
      <dc:creator>Ken Robinson</dc:creator>
      <dc:date>2005-01-04T10:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454930#M31720</link>
      <description>note that the file length hint may be invalid. The command ANAL/RMS/UPDATE attempts to update the file length hint. The help text for ANAL/RMS/UPDATE explains the file and record formats to which the file lenght hint applies.&lt;BR /&gt;You also need a recent version of VMS (its present in VMS V7.3-1 but no in V7.1).&lt;BR /&gt;&lt;BR /&gt;Parhaps something ingenious could be done with the SEARCH command in a PIPE.</description>
      <pubDate>Tue, 04 Jan 2005 10:11:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454930#M31720</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-01-04T10:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454931#M31721</link>
      <description>Prem,&lt;BR /&gt;&lt;BR /&gt;If you have GNV installed, just do it the same way you do it on Unix:&lt;BR /&gt;&lt;BR /&gt;$ bash -c wc -l &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;If not, a few lines of DCL should do the trick:&lt;BR /&gt;&lt;BR /&gt;$ open/read a 'p1&lt;BR /&gt;$ count = 0&lt;BR /&gt;$ loop:&lt;BR /&gt;$       read/end=all_done a line&lt;BR /&gt;$       count = count + 1&lt;BR /&gt;$       goto loop&lt;BR /&gt;$ all_done:&lt;BR /&gt;$ close a&lt;BR /&gt;$ write sys$output "There are ",count," records in ", f$parse("''p1'")&lt;BR /&gt;$ exit&lt;BR /&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 04 Jan 2005 12:01:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454931#M31721</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2005-01-04T12:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454932#M31722</link>
      <description>Craig, &lt;BR /&gt;&lt;BR /&gt;I am with you on the GNV solution.&lt;BR /&gt;&lt;BR /&gt;However, for the DCL script, if the input file has some size, it tends to be VERY MUCH slower than the PIPE | search solution by Ken.&lt;BR /&gt;&lt;BR /&gt;However, the DCL works on any version as far as I remember, the PIPE only in 7.2 &amp;amp; up.&lt;BR /&gt;&lt;BR /&gt;(and am __I__ writing this? The DCL aficionado?? Then again, PIPE should now also be considered native DCL, so...  )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;Jan</description>
      <pubDate>Tue, 04 Jan 2005 13:44:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454932#M31722</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-01-04T13:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454933#M31723</link>
      <description>Jan,&lt;BR /&gt;&lt;BR /&gt;No doubt you're right about the speed of DCL reads, but it's something that has always worked and I think it always will work.  Parsing the output of SEARCH will probably continue to work, but it's less certain.&lt;BR /&gt;&lt;BR /&gt;Just for something completely different, here's how to get the number of lines in a file into a DCL symbol using a one-line Perl command:&lt;BR /&gt;&lt;BR /&gt;$ perl -"MVMS::DCLsym" -ne "$i++; VMS::DCLsym-&amp;gt;setsym('rcnt',$i,'GLOBAL');"  test.txt&lt;BR /&gt;$ sh sym rcnt&lt;BR /&gt;  RCNT == "8"&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jan 2005 15:13:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454933#M31723</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2005-01-04T15:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454934#M31724</link>
      <description>SORT is very fast. I've attached a small MACRO32 program that does nothing more than count the records. I'd thought that bypassing the string matching might speed things up a bit, but my program isn't significantly faster than SORT, even for large files.&lt;BR /&gt;&lt;BR /&gt;However, it doesn't need PIPE to catch the record count, so you save yourself some process creations. File is LC.TXT. Rename to .MAR, then MACRO and LINK. Should work on all versions of OpenVMS, VAX, Alpha and IA64.&lt;BR /&gt;&lt;BR /&gt;The interface is foreign command, so define a symbol, use MCR or define DCL$PATH to include the directory containing the image.&lt;BR /&gt;&lt;BR /&gt;Return value is in R0, so it's in $STATUS. To prevent a spurious error, it's left shifted and the low bit is set (so it looks like a success status). To get the count, just divide $STATUS by 2. For example:&lt;BR /&gt;&lt;BR /&gt;$ LC MYFILE.TXT&lt;BR /&gt;$ stat=$STATUS&lt;BR /&gt;$ IF stat &lt;BR /&gt;$ THEN &lt;BR /&gt;$   count=stat/2&lt;BR /&gt;$ ELSE&lt;BR /&gt;$   ! error&lt;BR /&gt;$ ENDIF</description>
      <pubDate>Tue, 04 Jan 2005 18:13:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454934#M31724</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-01-04T18:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454935#M31725</link>
      <description>An other standard VMS program that is willing to spit out the number of records in a sequential file is copy:&lt;BR /&gt;&lt;BR /&gt;$ copy /log tmp.com   nl:&lt;BR /&gt;%COPY-S-COPIED, xxxx copied to NL: (5 records)&lt;BR /&gt;&lt;BR /&gt;This eliminates the need for a search or repeated read in the pipe line:&lt;BR /&gt;&lt;BR /&gt;$ pipe copy login.com nl:/log | (read sys$pipe line ; x= f$elem(1,"(",line) - " records)" ; defi/job lines &amp;amp;x )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;An other way for to solve this in perl with a logical name is:&lt;BR /&gt;&lt;BR /&gt;$ perl -e "{} while &amp;lt;&amp;gt;; $ENV{'lines'}=$." &amp;lt; tmp.idx&lt;BR /&gt;$ show log lines&lt;BR /&gt;   "LINES" = "2000" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;Pretty clean and flexible. Cheaper than piping.&lt;BR /&gt;&lt;BR /&gt;Or with perl and the return status:&lt;BR /&gt;&lt;BR /&gt;$ perl -e "{} while &amp;lt;&amp;gt;; exit $.*10 + 1" &amp;lt; tmp.idx&lt;BR /&gt;$ show symb $status&lt;BR /&gt;  $STATUS == "%X00004E21"&lt;BR /&gt;$ lines =$status/10&lt;BR /&gt;$ show symb lines&lt;BR /&gt;  LINES = 2000   Hex = 000007D0  Octal = 00000003720&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jan 2005 18:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454935#M31725</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-01-04T18:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454936#M31726</link>
      <description>If you have large files to check, and you consider to use John's solution (macro program) you can speed up it a litle. Replace the following line:&lt;BR /&gt;         $GET    RAB=InRAB&lt;BR /&gt;by&lt;BR /&gt;        $FIND    RAB=InRAB.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jan 2005 05:38:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454936#M31726</guid>
      <dc:creator>Aleksander Sinigoj</dc:creator>
      <dc:date>2005-01-05T05:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454937#M31727</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;First I am overwhelmed with the fast response I got from all of you. Thanks all of you I appreciate it. I would like to test which one of the procedures suggested is not resource intensive and use that&lt;BR /&gt;&lt;BR /&gt;Hi Greetz,&lt;BR /&gt;&lt;BR /&gt;I tried file_length_attributes before I put this question into the forum and it did not work properly. &lt;BR /&gt;&lt;BR /&gt;Hi Volker,&lt;BR /&gt;&lt;BR /&gt;It is working, But I am using the option given by Ken.&lt;BR /&gt;&lt;BR /&gt;Hi Craig/Jan,&lt;BR /&gt;&lt;BR /&gt;GNV is not installed, But I do not want to open the file and do the DCL commands the reason being the files are 200/300 MB and it will take long time to execute.&lt;BR /&gt;&lt;BR /&gt;Hi Hein,&lt;BR /&gt;&lt;BR /&gt;I would not use copy for the simple reason of the file size and I do not have perl installed in the system.</description>
      <pubDate>Wed, 05 Jan 2005 05:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454937#M31727</guid>
      <dc:creator>Prem Mohan</dc:creator>
      <dc:date>2005-01-05T05:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454938#M31728</link>
      <description>read a head with multiple multiblock buffers may also speed up the program.</description>
      <pubDate>Wed, 05 Jan 2005 05:44:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454938#M31728</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-01-05T05:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454939#M31729</link>
      <description>&amp;gt;&amp;gt; I would not use copy for the simple reason of the file size &lt;BR /&gt;&lt;BR /&gt;Well, my suggestion does not acutally copy the file. The output goes to the null device (NL:). Try it, Time it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; 200+ MB, at least we'll know that any pipe overhead will be neglectable.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; and I do not have perl installed in the system.&lt;BR /&gt;&lt;BR /&gt;Well, you should. QED!&lt;BR /&gt;What problem are you _really_ trying to solve? &lt;BR /&gt;A number of lines is often interesting, but not the ultimate goal.&lt;BR /&gt;You may find that the subsequent processing, is more readily done in perl than anything else.&lt;BR /&gt;&lt;BR /&gt;And if you were to special case a program for this, then indeed the RMS call $FIND will be faster than $GET, and use MBF=120, MBC=4, ROP=RAH, SHR=UPI. It return the byte count.&lt;BR /&gt;&lt;BR /&gt;Be sure to try native C - IO or even COBOL or SORT to read it, because they will NOT use RMS for simple, unshared sequential files. The CPU overhead for going into RMS (Executive inner mode) and back is simply too high when all you do is count records and bytes.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jan 2005 07:14:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454939#M31729</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-01-05T07:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454940#M31730</link>
      <description>Hien, are you saying some C IO routines will not use RMS sometimes (do they use RMS to open then ACP QIO READ virtual block)?&lt;BR /&gt;I thought C RTL always used RMS record I/O but parhaps things have changed.</description>
      <pubDate>Wed, 05 Jan 2005 09:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454940#M31730</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-01-05T09:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454941#M31731</link>
      <description>Ian,&lt;BR /&gt;&lt;BR /&gt;Yes indeed. I thought it was an opportune moment to point out that it has been recognized that RMS Record IO is some times TOO CPU expensive, due to the CMEXEC, argument probing, and so on. This is all there to support safe file sharing, and multiple file organization. If all you are doing is a simple sequential file read (variable, stream, fixed), then rolling your own using SYS$READ or QIO is more expedient.&lt;BR /&gt;&lt;BR /&gt;The C RTL has recognized this first, next COBRTL (same folks more or less), and of course SORT.&lt;BR /&gt;&lt;BR /&gt;If one really want to do this well, you would want to build in double (or more) buffering for max IO speed, and you even might consider IO_PERFORM for repeated reads fo very large simple files. And ideally you might consider sys$getjpi / getsyi to read default rms buffer settings, in case they are larger then the program defaults (C RTL does this, I happen to have coded the dcl support for this best I remember.).&lt;BR /&gt;&lt;BR /&gt;Hein.</description>
      <pubDate>Wed, 05 Jan 2005 10:40:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454941#M31731</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-01-05T10:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454942#M31732</link>
      <description>Hein, which version was this implemented for C and does it apply to read and fgets ?&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jan 2005 12:16:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454942#M31732</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-01-05T12:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454943#M31733</link>
      <description>Oh, best I know this has been the case 'forever' in DECC and since 1990 or so for VAXC.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jan 2005 14:16:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454943#M31733</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-01-05T14:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454944#M31734</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;$  pipe sear/noout/stat &lt;FILENAME&gt; "" | sear sys$pipe "Records sear" | -&lt;BR /&gt;( read sys$pipe line ; num = f$ele(2," ", f$edi(line,"compress")) ; def /job numl &amp;amp;num ) &lt;BR /&gt;$ numl = f$trn("numl")&lt;BR /&gt;$ sh sym numl   &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;works fine from the command line, But when I use the same into a com file to be executed the output shows 0.&lt;BR /&gt;&lt;BR /&gt;Please tell me what am I doing wrong.&lt;BR /&gt;The com file is enclosed for your review.&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Prem.&lt;BR /&gt;&lt;BR /&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Wed, 12 Jan 2005 08:37:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454944#M31734</guid>
      <dc:creator>Prem Mohan</dc:creator>
      <dc:date>2005-01-12T08:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the NUmber of lines in a file into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454945#M31735</link>
      <description>Prem,&lt;BR /&gt;&lt;BR /&gt;could it be that the default directory when you run the comfile is NOT the directory where your .PP file is located?&lt;BR /&gt;All through the script you speel out the locations of various files (which I HIGHLY endorse! It prevents so many glitches!), EXCEPT for the line:&lt;BR /&gt;&lt;BR /&gt; pipe sear/noout/stat 0103_WAT002616_00.PP "" | sear sys$pipe "Records sear" | -&lt;BR /&gt;&lt;BR /&gt;Check this first, please.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;Jan</description>
      <pubDate>Wed, 12 Jan 2005 09:14:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-get-the-number-of-lines-in-a-file-into-a-variable/m-p/3454945#M31735</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-01-12T09:14:00Z</dc:date>
    </item>
  </channel>
</rss>

