<?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 lexical function in a dcl-command file with OpenVMS in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681006#M40421</link>
    <description>Re John:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;[aside... hey jpe, no disrespect intended, but EDT was made obsolete in 1983 with the release of VMS V4.0, is it really appropriate to expose new people to such an old, klunky and seriously limited utility?]&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;John, I know. Interactively I use TPU. But I have always found the non-interactive use of TPU "a bit" clumsy &amp;amp; untidy, where EDT worked/works just fine. (And for really complex batch editting I have been known to go back even further to SLUM (not even sure about that name anymore) or TECO, but then I require the manual.&lt;BR /&gt;&lt;BR /&gt;But for not-too-complex batch editting, like this, EDT is still my choice. Despite the limits (of which the max line length has bitten me most often). Shows my age well I guess.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 31 Aug 2010 06:47:34 GMT</pubDate>
    <dc:creator>Jan van den Ende</dc:creator>
    <dc:date>2010-08-31T06:47:34Z</dc:date>
    <item>
      <title>Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681000#M40415</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a script to run on my system. This script creates a text file every day. I have the following problems. How can I solve these issues in a DCL script?&lt;BR /&gt;&lt;BR /&gt;1st:&lt;BR /&gt;I want the first and last line completely delete from this text file. The first line is empty and the last line always contains the same text string.&lt;BR /&gt;&lt;BR /&gt;Second:&lt;BR /&gt;For all other rows (the number of rows varies daily) I would like to delete any spaces.&lt;BR /&gt;&lt;BR /&gt;I hope my English is to be understood.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Rick</description>
      <pubDate>Mon, 30 Aug 2010 14:49:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681000#M40415</guid>
      <dc:creator>Flex_2</dc:creator>
      <dc:date>2010-08-30T14:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681001#M40416</link>
      <description>Hi Rick,&lt;BR /&gt;&lt;BR /&gt;Welcome to the ITRC forum.&lt;BR /&gt;&lt;BR /&gt;Here is one way of doing this. This method involves reading the entire file&lt;BR /&gt;contents and then doing the modifications required on every line.&lt;BR /&gt;Hence may not be the best way of achieving the desired result.&lt;BR /&gt;&lt;BR /&gt;Lets say you have created a file TEMP.TXT.&lt;BR /&gt;&lt;BR /&gt;Then you need to open and read all the lines of the file TEMP.TXT.&lt;BR /&gt;...&lt;BR /&gt;OPEN FILEPTR "TEMP.TXT"&lt;BR /&gt;READ/END_OF_FILE=END_LOOP FILEPTR Line&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Copy all the lines of this file to a new file.&lt;BR /&gt;During this,&lt;BR /&gt;- Dont copy&lt;BR /&gt;  - first line (first read operation)&lt;BR /&gt;  - the last line which has a known string.&lt;BR /&gt;    Use F$MATCH_WILD lexical to detect the pattern&lt;BR /&gt;- Remove spaces from other lines&lt;BR /&gt;  Use F$EDIT lexical with "TRIM"/"COMPRESS"/"COLLAPSE " based on your requirement.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Murali</description>
      <pubDate>Mon, 30 Aug 2010 15:20:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681001#M40416</guid>
      <dc:creator>P Muralidhar Kini</dc:creator>
      <dc:date>2010-08-30T15:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681002#M40417</link>
      <description>&lt;!--!*#--&gt;Do you have PERL or AWK at your disposal?&lt;BR /&gt;This is a trivial exercise in those languages.&lt;BR /&gt;See example below.&lt;BR /&gt;Real OpenVMS folks would write an TPU/EDT macro for this.&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ cre tmp.txt&lt;BR /&gt;first line&lt;BR /&gt;secone line with spaces&lt;BR /&gt;  third line with leading and trailing space&lt;BR /&gt;last line&lt;BR /&gt;$&lt;BR /&gt;$ perl -ne "next if 1==$.; last if eof; s/[ \t]//g; print" tmp.txt &amp;gt; tmp.tmp&lt;BR /&gt;$&lt;BR /&gt;$ type tmp.tmp&lt;BR /&gt;seconelinewithspaces&lt;BR /&gt;thirdlinewithleadingandtrailingspace&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;-ne ## loop over input, no auto print&lt;BR /&gt;next if 1==$.; ## if the line number is 1&lt;BR /&gt;last if eof; ## if an end of file next&lt;BR /&gt;s/[ \t]//g; ## substitute &lt;BR /&gt;&lt;BR /&gt;print ## the default variable $_ ... if it gets here&lt;BR /&gt;&lt;BR /&gt;&amp;gt; tmp.tmp ## redirect output&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Aug 2010 15:58:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681002#M40417</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-08-30T15:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681003#M40418</link>
      <description>lunchbreak...&lt;BR /&gt;&lt;BR /&gt;The perl I showed stripped tabs (\t) and spaces. If you just are conderned with spaced, use:&lt;BR /&gt;&lt;BR /&gt;s/ //g;&lt;BR /&gt;&lt;BR /&gt;If you insist on DCL, try script below using&lt;BR /&gt;it as: $ @strip/out=new.txt old.txt&lt;BR /&gt;&lt;BR /&gt;---- strip.com --------------------&lt;BR /&gt;$ if p1.eqs."" then exit 16&lt;BR /&gt;$ open/read/erro=oops  file 'p1&lt;BR /&gt;$ read file record ! blow aways first line&lt;BR /&gt;$ read file record ! read and edit second record before loop&lt;BR /&gt;$ last = f$edit(record,"COLLAPSE")&lt;BR /&gt;$&lt;BR /&gt;$loop:&lt;BR /&gt;$  read/erro=oops/end=done  file record&lt;BR /&gt;$  write sys$output last&lt;BR /&gt;$  last = f$edit(record,"COLLAPSE")&lt;BR /&gt;$  goto loop&lt;BR /&gt;$&lt;BR /&gt;$done:&lt;BR /&gt;$ close/nolog file&lt;BR /&gt;$oops:&lt;BR /&gt;$ exit .NOT.%x10000000 .AND. '$status&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Aug 2010 16:50:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681003#M40418</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-08-30T16:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681004#M40419</link>
      <description>Rick,&lt;BR /&gt;&lt;BR /&gt;I think I would make an EDT command file.&lt;BR /&gt;&lt;BR /&gt;$ cre MODIFY.EDT&lt;BR /&gt;dl&lt;BR /&gt;s/ //wh&lt;BR /&gt;.end&lt;BR /&gt;-1&lt;BR /&gt;dl&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Explanation:&lt;BR /&gt;d - delete line&lt;BR /&gt;s/ //wh   - substitute string between first and second separator ( I prefer "/", unless I need to do something with /'s, in which case I use "?" or "|", matter of taste ). That string in your question is one space.&lt;BR /&gt;Replace it by the string between second an third separator, in you question, nothing.&lt;BR /&gt;Then wh - specifies to do this over the WHole file.&lt;BR /&gt;. end - move to end of file&lt;BR /&gt;- 1  - up one line&lt;BR /&gt;dl - delete line&lt;BR /&gt;&lt;BR /&gt;Now invoke EDT with this specification.&lt;BR /&gt;&lt;BR /&gt;$ EDITT/EDT/COMMAND=MODIFY.EDT file-to-be-modified.&lt;BR /&gt;&lt;BR /&gt;Save MODIFY.EDT and use as often as needed.&lt;BR /&gt;&lt;BR /&gt;Note EDITT with an extra T, to avoid any EDIT symbol.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Aug 2010 17:33:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681004#M40419</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2010-08-30T17:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681005#M40420</link>
      <description>Rick,&lt;BR /&gt;&lt;BR /&gt;  As others have posted, you can write another script in whatever language you like best to edit the text file. Personally I'd choose Perl for this particular task.&lt;BR /&gt;&lt;BR /&gt;[aside... hey jpe, no disrespect intended, but EDT was made obsolete in 1983 with the release of VMS V4.0, is it really appropriate to expose new people to such an old, klunky and seriously limited utility?]&lt;BR /&gt;&lt;BR /&gt;  Wouldn't it make more sense to go back to the script that's creating the file, and modify it to output the text file in the format you really want?&lt;BR /&gt;&lt;BR /&gt;  Or, look at the reasons you want the file edited, perhaps it's for input into another script. Can that be modified to apply the edits as it runs?&lt;BR /&gt;&lt;BR /&gt;  The point here is you can always "fix" something by adding yet another step in a process, BUT most of the time that adds extra dependencies and extra opportunities for things to go wrong, to say nothing of additional resources used in re-processing data.&lt;BR /&gt;&lt;BR /&gt;  In general I know I'm going in the right direction when I'm REMOVING code and simplifying processes.</description>
      <pubDate>Mon, 30 Aug 2010 23:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681005#M40420</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-30T23:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681006#M40421</link>
      <description>Re John:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;[aside... hey jpe, no disrespect intended, but EDT was made obsolete in 1983 with the release of VMS V4.0, is it really appropriate to expose new people to such an old, klunky and seriously limited utility?]&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;John, I know. Interactively I use TPU. But I have always found the non-interactive use of TPU "a bit" clumsy &amp;amp; untidy, where EDT worked/works just fine. (And for really complex batch editting I have been known to go back even further to SLUM (not even sure about that name anymore) or TECO, but then I require the manual.&lt;BR /&gt;&lt;BR /&gt;But for not-too-complex batch editting, like this, EDT is still my choice. Despite the limits (of which the max line length has bitten me most often). Shows my age well I guess.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Aug 2010 06:47:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681006#M40421</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2010-08-31T06:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681007#M40422</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;thank you first for the answers. I will try the tips equal times.&lt;BR /&gt;&lt;BR /&gt;An addition: Some of the answers related to other languages. However, I have a closed system. That means I can work only on the OpenVMS machine with DCL.&lt;BR /&gt;&lt;BR /&gt;Greeting&lt;BR /&gt;&lt;BR /&gt;Rick</description>
      <pubDate>Tue, 31 Aug 2010 07:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681007#M40422</guid>
      <dc:creator>Flex_2</dc:creator>
      <dc:date>2010-08-31T07:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681008#M40423</link>
      <description>&amp;gt;&amp;gt; An addition: Some of the answers related to other languages. However, I have a closed system. That means I can work only on the OpenVMS machine with DCL.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The system is open. &lt;BR /&gt;The minds are closed.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Aug 2010 11:19:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681008#M40423</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-08-31T11:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681009#M40424</link>
      <description>but noone mentioned SUMSLP :-)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/doc/73final/documentation/pdf/OVMS_SUMSLP_UTIL.pdf" target="_blank"&gt;http://h71000.www7.hp.com/doc/73final/documentation/pdf/OVMS_SUMSLP_UTIL.pdf&lt;/A&gt;</description>
      <pubDate>Tue, 31 Aug 2010 13:06:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681009#M40424</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2010-08-31T13:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexical function in a dcl-command file with OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681010#M40425</link>
      <description>&amp;gt;&amp;gt;&amp;gt; but noone mentioned SUMSLP :-)&lt;BR /&gt;&lt;BR /&gt;...because it looks like a real challenge to do the job with EDIT/SUM and its editing commands.&lt;BR /&gt;&lt;BR /&gt;But if you have GNV installed, a one-liner (probably wrapped, here) can do it:&lt;BR /&gt;&lt;BR /&gt;$ mc gnu:[bin]awk "{if(FNR&amp;gt;2)print prev;prev="""";for(i=1;i&amp;lt;=NF;i++)prev=prev$i}" your-input-file.txt &amp;gt;your-output-file.txt&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Aug 2010 15:08:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexical-function-in-a-dcl-command-file-with-openvms/m-p/4681010#M40425</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2010-08-31T15:08:57Z</dc:date>
    </item>
  </channel>
</rss>

