<?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: Printing comments from the com script in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872265#M34912</link>
    <description>Or, the easy way, if you don't object to the&lt;BR /&gt;"$! " in the output:&lt;BR /&gt;&lt;BR /&gt;alp $ type x2.com&lt;BR /&gt;$!&lt;BR /&gt;$ goto start&lt;BR /&gt;$!&lt;BR /&gt;$ usage:&lt;BR /&gt;$!&lt;BR /&gt;$ type sys$input&lt;BR /&gt;$ deck /dollars = "$END"&lt;BR /&gt;$! Text line 1.&lt;BR /&gt;$! Text line 2.&lt;BR /&gt;$END&lt;BR /&gt;$!&lt;BR /&gt;$ return&lt;BR /&gt;$!&lt;BR /&gt;$ start:&lt;BR /&gt;$ if (p1 .eqs. "")&lt;BR /&gt;$ then&lt;BR /&gt;$    gosub usage&lt;BR /&gt;$    exit&lt;BR /&gt;$ endif&lt;BR /&gt;$!&lt;BR /&gt;$ write sys$output "Normal."&lt;BR /&gt;$!&lt;BR /&gt;&lt;BR /&gt;alp $ @ x2.com xxx&lt;BR /&gt;Normal.&lt;BR /&gt;&lt;BR /&gt;alp $ @ x2.com&lt;BR /&gt;$! Text line 1.&lt;BR /&gt;$! Text line 2.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I _do_ like DECK.</description>
    <pubDate>Fri, 29 Sep 2006 10:14:06 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2006-09-29T10:14:06Z</dc:date>
    <item>
      <title>Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872257#M34904</link>
      <description>Hi,&lt;BR /&gt;I am using VMS 7.3-2. I have a simple com script which requires P1 and P2. &lt;BR /&gt;&lt;BR /&gt;I have written comments from the first line of the script till I hit =====&lt;BR /&gt;so...&lt;BR /&gt;Example.com script&lt;BR /&gt;$! xxxx&lt;BR /&gt;$! xxxxx&lt;BR /&gt;$! xxxxx&lt;BR /&gt;$! USAGE:&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;$! ==============================&lt;BR /&gt;&lt;BR /&gt;Now in case a user does not pass p1 I want an error message which basically types up the above comments. &lt;BR /&gt;&lt;BR /&gt;I was thinking of using search or type command to read till "====" but I am not sure how I can open or search the current file. Since I will be executing the script and trying to type the comments on the screen. &lt;BR /&gt;&lt;BR /&gt;I am aware of $write sys$output ---&lt;BR /&gt;But that will be a bit tedious and am looking for a neater method. &lt;BR /&gt;&lt;BR /&gt;Nipun&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2006 08:54:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872257#M34904</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2006-09-29T08:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872258#M34905</link>
      <description>Nipun,&lt;BR /&gt;&lt;BR /&gt;A common enough requirement. The solution is to use the TYPE command in conjunction with SYS$INPUT, not comments. For example:&lt;BR /&gt;&lt;BR /&gt;$ IF F$LENGTH(P1) .EQ. 0&lt;BR /&gt;$    THEN&lt;BR /&gt;$       TYPE SYS$INPUT&lt;BR /&gt;You omitted the parameter to this file. Please supply a parameter of the form ...&lt;BR /&gt;&lt;BR /&gt;$       ENDIF&lt;BR /&gt;&lt;BR /&gt;I re-typed this, my apologies in advance if I have introduced some typographical errors.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Fri, 29 Sep 2006 09:00:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872258#M34905</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2006-09-29T09:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872259#M34906</link>
      <description>&lt;!--!*#--&gt;alp $ type x.com&lt;BR /&gt;$!&lt;BR /&gt;$ goto start&lt;BR /&gt;$!&lt;BR /&gt;$ usage:&lt;BR /&gt;$!&lt;BR /&gt;$ type sys$input&lt;BR /&gt;Text line 1.&lt;BR /&gt;Text line 2.&lt;BR /&gt;$!&lt;BR /&gt;$ return&lt;BR /&gt;$!&lt;BR /&gt;$ start:&lt;BR /&gt;$ if (p1 .eqs. "")&lt;BR /&gt;$ then&lt;BR /&gt;$    gosub usage&lt;BR /&gt;$    exit&lt;BR /&gt;$ endif&lt;BR /&gt;$!&lt;BR /&gt;$ write sys$output "Normal."&lt;BR /&gt;$!&lt;BR /&gt;&lt;BR /&gt;alp $ @ x.com xxx&lt;BR /&gt;Normal.&lt;BR /&gt;&lt;BR /&gt;alp $ @ x.com&lt;BR /&gt;Text line 1.&lt;BR /&gt;Text line 2.&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2006 09:06:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872259#M34906</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-09-29T09:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872260#M34907</link>
      <description>Hi Bob,&lt;BR /&gt;I this script is helpful. But there is one problem. &lt;BR /&gt;&lt;BR /&gt;I have been using these scripts in the past so I have put all the comments preceeing with a &lt;BR /&gt;&lt;BR /&gt;$!&lt;BR /&gt;&lt;BR /&gt;So those lines don't get out. Now I have 15-20 lines in several scripts so it would be very painful for me to manual change that. &lt;BR /&gt;&lt;BR /&gt;Would there be a better way ?&lt;BR /&gt;&lt;BR /&gt;Nipun</description>
      <pubDate>Fri, 29 Sep 2006 09:12:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872260#M34907</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2006-09-29T09:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872261#M34908</link>
      <description>&amp;gt; Now I have 15-20 lines in several scripts&lt;BR /&gt;&amp;gt; so it would be very painful for me to&lt;BR /&gt;&amp;gt; manual change that.&lt;BR /&gt;&lt;BR /&gt;This sounds like a few seconds worth of work&lt;BR /&gt;in any text editor.  Adding the TYPE command&lt;BR /&gt;should require more time.  Your idea of&lt;BR /&gt;"very painful" seems to differ from mine.</description>
      <pubDate>Fri, 29 Sep 2006 09:20:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872261#M34908</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-09-29T09:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872262#M34909</link>
      <description>Nipun,&lt;BR /&gt;&lt;BR /&gt;I would recommend the change, iterating through a series of files and making this type of change is not too difficult. You can use the command DIRECTORY/OUTPUT/NOHEAD/NOTRAIL to produce a list of files to be edited and make a command file out of them. You will also need to insert an ASSIGN/USER TT SYS$INPUT before each invocation of your favorite editor. This is not too difficult to do, unless you have hundreds of files (in which case a command file can generate the command file).&lt;BR /&gt;&lt;BR /&gt;A quick (and VERY UGLY) fix is to use the DECK command to supress the behavior of the leading dollar signs for the display of the comments. You will also need to insert the trailing marker as described in the HELP text. Would I use this method? NO.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Fri, 29 Sep 2006 09:43:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872262#M34909</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2006-09-29T09:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872263#M34910</link>
      <description>Hi Steve, &lt;BR /&gt;My response was for Bob not yours. &lt;BR /&gt;Your response must have come while I was typing mine. &lt;BR /&gt;&lt;BR /&gt;Nipun</description>
      <pubDate>Fri, 29 Sep 2006 09:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872263#M34910</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2006-09-29T09:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872264#M34911</link>
      <description>I agree with Steve.&lt;BR /&gt;The real solution is to make the comments be the usage text. It really is a minor edit and the scripts will look better:&lt;BR /&gt;&lt;BR /&gt;----------------------------------------&lt;BR /&gt;$if p1.nes."" then goto got_p1&lt;BR /&gt;$type sys$input&lt;BR /&gt;&lt;BR /&gt;  xxxx&lt;BR /&gt;  xxxxx&lt;BR /&gt;  xxxxx&lt;BR /&gt;  USAGE:&lt;BR /&gt;   ==============================&lt;BR /&gt;&lt;BR /&gt;$got_p1:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now if you insist on using the crummy, yet firmly established and widely followed comment construct, might I recommend perl?:&lt;BR /&gt;&lt;BR /&gt;--------------------------------&lt;BR /&gt;$! xxxx&lt;BR /&gt;$! xxxxx&lt;BR /&gt;$! xxxxx&lt;BR /&gt;$! USAGE:&lt;BR /&gt;$! ==============================&lt;BR /&gt;$if p1.eqs."" then perl -ne -&lt;BR /&gt;  "exit 268435472 if /====/; print if (s/^\$! / /)" 'F$ENV("PROCEDURE")&lt;BR /&gt;$!all is well...&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2006 09:51:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872264#M34911</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-09-29T09:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872265#M34912</link>
      <description>Or, the easy way, if you don't object to the&lt;BR /&gt;"$! " in the output:&lt;BR /&gt;&lt;BR /&gt;alp $ type x2.com&lt;BR /&gt;$!&lt;BR /&gt;$ goto start&lt;BR /&gt;$!&lt;BR /&gt;$ usage:&lt;BR /&gt;$!&lt;BR /&gt;$ type sys$input&lt;BR /&gt;$ deck /dollars = "$END"&lt;BR /&gt;$! Text line 1.&lt;BR /&gt;$! Text line 2.&lt;BR /&gt;$END&lt;BR /&gt;$!&lt;BR /&gt;$ return&lt;BR /&gt;$!&lt;BR /&gt;$ start:&lt;BR /&gt;$ if (p1 .eqs. "")&lt;BR /&gt;$ then&lt;BR /&gt;$    gosub usage&lt;BR /&gt;$    exit&lt;BR /&gt;$ endif&lt;BR /&gt;$!&lt;BR /&gt;$ write sys$output "Normal."&lt;BR /&gt;$!&lt;BR /&gt;&lt;BR /&gt;alp $ @ x2.com xxx&lt;BR /&gt;Normal.&lt;BR /&gt;&lt;BR /&gt;alp $ @ x2.com&lt;BR /&gt;$! Text line 1.&lt;BR /&gt;$! Text line 2.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I _do_ like DECK.</description>
      <pubDate>Fri, 29 Sep 2006 10:14:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872265#M34912</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-09-29T10:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872266#M34913</link>
      <description>&lt;!--!*#--&gt;Sounds like you want something like:&lt;BR /&gt;&lt;BR /&gt;search /nohighlight /window=(99,0) 'F$ENVIRONMENT("procedure") "==''=="&lt;BR /&gt;&lt;BR /&gt;Adjust search string as necessary to not produce undesirable matches with other content in the command file(s).&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Fri, 29 Sep 2006 18:27:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872266#M34913</guid>
      <dc:creator>jaw_1</dc:creator>
      <dc:date>2006-09-29T18:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872267#M34914</link>
      <description>James makes an excellent suggestion.  Here's a simple way to clean it up even more:&lt;BR /&gt;&lt;BR /&gt;Using the EachLine script (from dcl.openvms.org), and the pipe command, you can get rid of the $! and $! =======... too.&lt;BR /&gt;&lt;BR /&gt;$ pipe search 'f$env("Procedure") "$! ===="/wind=(99,0) | search sys$pipe "$! ===="/match=nor | eachline in "write sys$output in-""$!"""&lt;BR /&gt;&lt;BR /&gt;This one-liner will give you the contents of the comments without the prefix on each line, and without the end-comment line.</description>
      <pubDate>Tue, 03 Oct 2006 11:46:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872267#M34914</guid>
      <dc:creator>Aaron Sakovich</dc:creator>
      <dc:date>2006-10-03T11:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872268#M34915</link>
      <description>Thanks James and Aaron,&lt;BR /&gt;I am still exploring different options. Your suggestions look directly applicable to my current problem. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I will try to test this in a day or two and provide an update. &lt;BR /&gt;&lt;BR /&gt;Thank you everyone for your feedback ...as I mentioned will provided an update in a day or two...&lt;BR /&gt;&lt;BR /&gt;Nipun</description>
      <pubDate>Tue, 03 Oct 2006 13:00:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872268#M34915</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2006-10-03T13:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872269#M34916</link>
      <description>Hi James,&lt;BR /&gt;I tried the routine you suggested however, &lt;BR /&gt;the output comes out to be the entire script.&lt;BR /&gt;I think it doesn't stop the search at the first instance of the ====== sign but rather on the search command below which has the specified line "===="&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I executed the following line &lt;BR /&gt;search /nohighlight /window=(99,0) 'F$ENVIRONMENT("procedure") "==''=="&lt;BR /&gt;&lt;BR /&gt;I also changed the wind =(0,0) &lt;BR /&gt;but it didn't make a different. I am attaching the script file for feedback</description>
      <pubDate>Thu, 05 Oct 2006 09:03:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872269#M34916</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2006-10-05T09:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Printing comments from the com script</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872270#M34917</link>
      <description>Yeah, you are latching on to your own search string.&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;$!========================================&lt;BR /&gt;$ IF P1 .EQS ""&lt;BR /&gt;$ THEN&lt;BR /&gt;$ x="======"&lt;BR /&gt;$  search /nohighlight /window=(99,0) 'F$ENVIRONMENT("procedure") 'x''x'&lt;BR /&gt;&lt;BR /&gt;Or how is this for cute:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$!&lt;BR /&gt;$i="======================================"&lt;BR /&gt;$ IF P1 .EQS ""&lt;BR /&gt;$ THEN&lt;BR /&gt;$  search /nohighlight /window=(99,0) 'F$ENVIRONMENT("procedure") 'i&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Still... did you try the PERL solution I showed? It gives SO MUCH control. Trivial to only do comments, trivial to remove the actual comment introducer, and so on.&lt;BR /&gt;&lt;BR /&gt;And show about a re-write into the $type sys$input variant?&lt;BR /&gt;A simple (perl!?) script could easily do this on all your dcl scripts.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Oct 2006 09:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/printing-comments-from-the-com-script/m-p/3872270#M34917</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-10-05T09:21:58Z</dc:date>
    </item>
  </channel>
</rss>

