<?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: DCL in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374600#M93754</link>
    <description>You're not on Unix, and OpenVMS DCL redirection is comparatively weak.  And there are some wrinkles here between DCL symbols and logical names, and subprocesses.&lt;BR /&gt;&lt;BR /&gt;In general, this doesn't work.  Symbols are "bigger" on recent OpenVMS releases, but not big enough to contain the output from many DCL commands.&lt;BR /&gt;&lt;BR /&gt;The OpenVMS User's Guide is the manual you want to read here.  This is in the OpenVMS documentation set.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hp.com/go/openvms/doc" target="_blank"&gt;http://www.hp.com/go/openvms/doc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That material will help you understand symbols and logical names and how to deal with /OUTPUT qualifiers and command redirection and such.&lt;BR /&gt;&lt;BR /&gt;The OpenVMS Frequently Asked Questions (FAQ) has how to pass command output around using the PIPE command and logical names.  There's a copy of the FAQ here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hoffmanlabs.com/vmsfaq/" target="_blank"&gt;http://www.hoffmanlabs.com/vmsfaq/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There's another book around, _Writing Real Programs in DCL_ by Paul Anagnostopoulos and somebody named Hoffman, but that book is presently out of print and used copies of the second edition are reportedly expensive.   It's now conceivable that this book might come back into print if there's enough demand, though not through the fine folks over at the Elsevier Digital Press imprint; the previous publishers.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Mar 2009 12:18:19 GMT</pubDate>
    <dc:creator>Hoff</dc:creator>
    <dc:date>2009-03-09T12:18:19Z</dc:date>
    <item>
      <title>DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374598#M93752</link>
      <description>could some one tell how to pass a command output &lt;BR /&gt;to an variable&lt;BR /&gt;&lt;BR /&gt;I shall be thank full if you share some DCL scripting guide/book/document &lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Mon, 09 Mar 2009 11:37:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374598#M93752</guid>
      <dc:creator>Bjay</dc:creator>
      <dc:date>2009-03-09T11:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374599#M93753</link>
      <description>Bjay,&lt;BR /&gt;&lt;BR /&gt;The simplest way to get the output of a command to a place where it can be read and analyzed is to use the ASSIGN/USER_MODE to route the logical name SYS$OUTPUT to a temporary file.&lt;BR /&gt;&lt;BR /&gt;For an introduction to logical names, see "Logical Names (Part 1)", part of The OpenVMS Consultant series of columns on OpenVMS.org (see &lt;A href="http://www.openvms.org/gezelter" target="_blank"&gt;http://www.openvms.org/gezelter&lt;/A&gt; ).&lt;BR /&gt;&lt;BR /&gt;The "DCL Dictionary" manual is available on the OpenVMS www site at &lt;A href="http://h71000.www7.hp.com/doc/83final/9996/9996pro.html" target="_blank"&gt;http://h71000.www7.hp.com/doc/83final/9996/9996pro.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://wwws.rlgsc.com" target="_blank"&gt;http://wwws.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Mon, 09 Mar 2009 12:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374599#M93753</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2009-03-09T12:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374600#M93754</link>
      <description>You're not on Unix, and OpenVMS DCL redirection is comparatively weak.  And there are some wrinkles here between DCL symbols and logical names, and subprocesses.&lt;BR /&gt;&lt;BR /&gt;In general, this doesn't work.  Symbols are "bigger" on recent OpenVMS releases, but not big enough to contain the output from many DCL commands.&lt;BR /&gt;&lt;BR /&gt;The OpenVMS User's Guide is the manual you want to read here.  This is in the OpenVMS documentation set.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hp.com/go/openvms/doc" target="_blank"&gt;http://www.hp.com/go/openvms/doc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That material will help you understand symbols and logical names and how to deal with /OUTPUT qualifiers and command redirection and such.&lt;BR /&gt;&lt;BR /&gt;The OpenVMS Frequently Asked Questions (FAQ) has how to pass command output around using the PIPE command and logical names.  There's a copy of the FAQ here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hoffmanlabs.com/vmsfaq/" target="_blank"&gt;http://www.hoffmanlabs.com/vmsfaq/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There's another book around, _Writing Real Programs in DCL_ by Paul Anagnostopoulos and somebody named Hoffman, but that book is presently out of print and used copies of the second edition are reportedly expensive.   It's now conceivable that this book might come back into print if there's enough demand, though not through the fine folks over at the Elsevier Digital Press imprint; the previous publishers.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Mar 2009 12:18:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374600#M93754</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2009-03-09T12:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374601#M93755</link>
      <description>You may want to describe the specific problem you want to address. As replied above, there is no common, single solution. Many folks parse file output, several commands having a /OUT qualifier. Some commands leave DCL symbols (SEARCH) to use. Some use a PIPE construct to snarf output and put it into a logical name.&lt;BR /&gt;&lt;BR /&gt;But most importantly you need to realize that often you do NOT need a command. DCL has a set of powerful LEXICAL to do what on other platforms (Unix) is done using a command.&lt;BR /&gt;For example, check out HELP LEXI F$SEARCH as a (better!) alternative to capture the DIRECTORY command output. Ans G$GETDVI and F$FILE and so on.... Check HELP and... RTFM!&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Mar 2009 12:25:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374601#M93755</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-09T12:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374602#M93756</link>
      <description>Try using the "PIPE" command.   For example, consider the command;&lt;BR /&gt;&lt;BR /&gt;$ dir/size=all/grand [...]*.*.*&lt;BR /&gt;&lt;BR /&gt;Grand total of 38 directories, 697 files, 26981/71686 blocks.&lt;BR /&gt;&lt;BR /&gt;Now lets say you want to assign the #of files and total blocks to symbols to use within a script.    If P1 is the directory listing ("[...]*.*.*"), then the following command will define the symbols;  NFiles = "number of files", and NBlks = Total Blocks.&lt;BR /&gt;&lt;BR /&gt;$ Pipe Dir/Size=all/grand 'P1' | (Read Sys$Input Line ; Read Sys$Input Line ; -&lt;BR /&gt;                Files = f$elem(5," ",Line) ; -&lt;BR /&gt;                Blks = f$elem(1,"/",f$elem(7," ",Line)) ; -&lt;BR /&gt;                define/job/NoLog Nfiles &amp;amp;files ;-&lt;BR /&gt;                define/job/NoLog Nblks &amp;amp;blks)&lt;BR /&gt;$       Nfiles == F$TrnLnm("NFiles","Lnm$Job")&lt;BR /&gt;$       NBlks == F$TrnLnm("NBlks","Lnm$Job")&lt;BR /&gt;&lt;BR /&gt;Its a bit clunky, but it is very flexible.&lt;BR /&gt;&lt;BR /&gt;Dave.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Mar 2009 11:15:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374602#M93756</guid>
      <dc:creator>The Brit</dc:creator>
      <dc:date>2009-03-10T11:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374603#M93757</link>
      <description>&lt;!--!*#--&gt;Dave's PIPE example but done in PERL ...&lt;BR /&gt;&lt;BR /&gt;$ perl -e "for (qx(dir/size=all/grand *.*)){ if (/(\d+) fil.*\/(\d+)/) { $ENV{files}=$1; $ENV{blocks}=$2}}"&lt;BR /&gt;&lt;BR /&gt;$ show log  files, blocks&lt;BR /&gt;   "FILES" = "514" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;   "BLOCKS" = "421728" (LNM$PROCESS_TABLE)&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Same thing using those LEXICALS and a DCL loop:&lt;BR /&gt;&lt;BR /&gt;-----------------------&lt;BR /&gt;$files == 0&lt;BR /&gt;$blocks == 0&lt;BR /&gt;$loop:&lt;BR /&gt;$  file = F$SEARCH ("*.*;*")&lt;BR /&gt;$  IF file .EQS. "" THEN EXIT&lt;BR /&gt;$  files == files + 1&lt;BR /&gt;$  blocks == blocks + F$FILE(file,"ALQ")&lt;BR /&gt;$  GOTO loop&lt;BR /&gt;--------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$SHOW SYMBOL files ...&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Mar 2009 11:42:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374603#M93757</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-10T11:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374604#M93758</link>
      <description>&lt;!--!*#--&gt;&amp;gt; You're not on Unix, [...]&lt;BR /&gt;&lt;BR /&gt;I agree.  On UNIX, it often makes sense to&lt;BR /&gt;use the `` or $() notation in a script to&lt;BR /&gt;collect the output from some command.  On VMS&lt;BR /&gt;it seldom does.  DCL has lexical functions&lt;BR /&gt;which can be used in expressions, and these&lt;BR /&gt;are more often the better way to do things.&lt;BR /&gt;&lt;BR /&gt;For example, on UNIX, one might try to parse&lt;BR /&gt;"df" output to find the free space on a file&lt;BR /&gt;system.  On VMS, it makes little sense to try&lt;BR /&gt;the same thing with SHOW DEVICE /FULL output&lt;BR /&gt;when the F$GETDVI lexical function can do it&lt;BR /&gt;easily:&lt;BR /&gt;&lt;BR /&gt;alp $ write sys$output f$getdvi( "dka0:", "freeblocks")&lt;BR /&gt;16733466&lt;BR /&gt;&lt;BR /&gt;&amp;gt; You may want to describe the specific&lt;BR /&gt;&amp;gt; problem [...]&lt;BR /&gt;&lt;BR /&gt;Another good idea.  Asking how to implement a&lt;BR /&gt;particular poor solution to a problem is&lt;BR /&gt;often less useful than asking how to solve&lt;BR /&gt;the actual problem.</description>
      <pubDate>Tue, 10 Mar 2009 18:39:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374604#M93758</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-03-10T18:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374605#M93759</link>
      <description>here is what I am doing&lt;BR /&gt;&lt;BR /&gt;1. I have a recording of monitor system command which is taken after every 5 mins&lt;BR /&gt;$ &lt;BR /&gt;&lt;BR /&gt;and this output is stored into files with time stamp in there name&lt;BR /&gt;&lt;BR /&gt;2. I have to generate a report of last one week disk IO's&lt;BR /&gt;so I create a list of monitor record files into a list file&lt;BR /&gt;$ dir &lt;DIRECTORY&gt; /since=&lt;START_DATE&gt; /before=&lt;END_DATE&gt; /column=1 /out=dir.lis&lt;BR /&gt;&lt;BR /&gt;3. then I read this file line by line and parse it to monitor command&lt;BR /&gt;&lt;BR /&gt;$ open /read rec dir.lis&lt;BR /&gt;$ rdloop:&lt;BR /&gt;$ read /end_of_file=endit rec val&lt;BR /&gt;$ define /user sys$output monrep.out&lt;BR /&gt;$ pipe monitor disk /input='val | sea sys$input dka0&lt;BR /&gt;$ goto rdloop&lt;BR /&gt;$ append monrep.out;* monrep.report &lt;BR /&gt;&lt;BR /&gt;4. then I read the monrep.report file and fetch out the desired information&lt;BR /&gt;$open /read inpt monrep.report&lt;BR /&gt;$ read /end_of_file=clsit inpt val2&lt;BR /&gt;$ val2=f$edit(val2,"compress,trim")&lt;BR /&gt;$ dsk=f$element(0,"",val2)&lt;BR /&gt;$ ios=f$element(4,"",val2)&lt;BR /&gt;&lt;BR /&gt;QUERY&lt;BR /&gt;========&lt;BR /&gt;IN STEP 3 WHERE I AM DEFINING THE OUTPUT TO A FILE TO WRITE TO THE FILE IS THERE OTHER WAY TO DO THAT&lt;/END_DATE&gt;&lt;/START_DATE&gt;&lt;/DIRECTORY&gt;</description>
      <pubDate>Wed, 11 Mar 2009 07:14:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374605#M93759</guid>
      <dc:creator>Bjay</dc:creator>
      <dc:date>2009-03-11T07:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374606#M93760</link>
      <description>I'd have thought it would be easier to simply run MONITOR/RECORD contionuously and then pull out the statistics you want with a MONITOR/INPUT&lt;BR /&gt;&lt;BR /&gt;Unless I misunderstood what you are trying to achieve....&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Wed, 11 Mar 2009 08:27:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374606#M93760</guid>
      <dc:creator>Craig A</dc:creator>
      <dc:date>2009-03-11T08:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374607#M93761</link>
      <description>these monitor recording files are of past we want to analyze the IO data of past</description>
      <pubDate>Wed, 11 Mar 2009 08:59:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374607#M93761</guid>
      <dc:creator>Bjay</dc:creator>
      <dc:date>2009-03-11T08:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374608#M93762</link>
      <description>&lt;!--!*#--&gt;&lt;BR /&gt;Ah, now we have a specific, and I think even a tricky question.&lt;BR /&gt;&lt;BR /&gt;Yikes, what an unpleasant task.&lt;BR /&gt;Mopping up after a poor past setup.&lt;BR /&gt;Be sure to check out T4 for the future!&lt;BR /&gt;&lt;BR /&gt;So anyway, they must have created those files with something like:&lt;BR /&gt;&lt;BR /&gt;$date = f$extract(0,16,f$cvtime()) -"-"-"-"-" "-":"-":"&lt;BR /&gt;$end = f$cvti("+0:1:0","ABSOLUTE")&lt;BR /&gt;$moni/end=&amp;amp;end/rec='date'.mon/nodisp disk&lt;BR /&gt;&lt;BR /&gt;?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; IN STEP 3 WHERE I AM DEFINING THE OUTPUT TO A FILE TO WRITE TO THE FILE IS THERE OTHER WAY TO DO THAT&lt;BR /&gt;&lt;BR /&gt;Well, you could add further pipe segments, but it gets really nasty quickly. Too hard!&lt;BR /&gt;&lt;BR /&gt;Next best _should_ be to be able to not to create the individual output files, but just make the output append with a  "&amp;gt;&amp;gt;" style operator. But DCL does not have that.&lt;BR /&gt;For non-pipe situations you can pre-open a file in DCL, and use that logical name as output device, but that does not work in pipe it seems (process permanent file in the wrong process).&lt;BR /&gt;&lt;BR /&gt;So IF I were to use only DCL for this mission then I would go the hard route, as you outlined already.&lt;BR /&gt;&lt;BR /&gt;Mind you... I would NOT use DIR/BEF to select files which are known to have a timestamp. Why become dependent on the file dates when you can avoid it?&lt;BR /&gt;&lt;BR /&gt;I would use a loop along the lines of:&lt;BR /&gt;&lt;BR /&gt;$loop:&lt;BR /&gt;$  file = f$search("*.mon")&lt;BR /&gt;$  IF file .EQS. "" THEN GOTO done&lt;BR /&gt;$  date =  F$EXTR(1,12,file) ! Adapt&lt;BR /&gt;$  IF date .LT. "200901010101" THEN GOTO loop&lt;BR /&gt;$  files = files + 1&lt;BR /&gt;$  PIPE MONI/INPU='file'/DISP=...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But then, I would not use DCL for this task. &lt;BR /&gt;I would use PERL. &lt;BR /&gt;It will allow me to do much more with the data gathered, and it will not mind dealing with decimal values.&lt;BR /&gt;&lt;BR /&gt;---------------------- test.pl -----------&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my $files = 0;&lt;BR /&gt;for my $file (&amp;lt;*.mon&amp;gt;) {&lt;BR /&gt;  my $date = substr($file,0,12); # adapt&lt;BR /&gt;  next if $date lt "200901010101";&lt;BR /&gt;  $files++;&lt;BR /&gt;  my ($time, $disk, $rate);&lt;BR /&gt;  for (qx(MONI/INPU=$file/DISP=SYS\$OUTPUT DISK)) {&lt;BR /&gt;    $time = $1 if /^\s+(\d+-\S+\s+\S+)/;&lt;BR /&gt;    if (/DKA0/) {&lt;BR /&gt;        m/^(\S+)\s.*?\s[0-9.]+\s+([0-9.]+)\s+/;&lt;BR /&gt;        $disk = $1;&lt;BR /&gt;        $rate = $2;&lt;BR /&gt;        print qq($time $disk $rate\n);&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;print qq(Processed $files files.\n);&lt;BR /&gt;-------------------&lt;BR /&gt;&lt;BR /&gt;$perl test.pl&lt;BR /&gt;:&lt;BR /&gt;11-MAR-2009 07:54:57.67 $8$DKA0: 0.70&lt;BR /&gt;11-MAR-2009 07:55:00.67 $8$DKA0: 0.70&lt;BR /&gt;11-MAR-2009 07:55:03.68 $8$DKA0: 0.70&lt;BR /&gt;11-MAR-2009 07:55:06.68 $8$DKA0: 0.70&lt;BR /&gt;11-MAR-2009 07:55:09.69 $8$DKA0: 0.70&lt;BR /&gt;11-MAR-2009 07:55:12.69 $8$DKA0: 0.69&lt;BR /&gt;Processed 5 files.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Mar 2009 11:58:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374608#M93762</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-11T11:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374609#M93763</link>
      <description>I'd pitch this home-grown monitoring environment and move to T4, and not spend any more time on the home-grown stuff than I could manage.  Build on T4 where you need to.&lt;BR /&gt;&lt;BR /&gt;The f$cvtime lexical function with the "COMPARISON" argument is your friend here, as is the f$file_attributes lexical with the "CDT" argument for the file creation date.&lt;BR /&gt;&lt;BR /&gt;Don't try to program with Unix and bash designs on OpenVMS; you'll end up frustrated and confused.  &lt;BR /&gt;&lt;BR /&gt;And do please acquire and read the Smart Questions FAQ.  Terse questions will quite often get you entirely correct -- and somewhere between misleading and entirely wrong -- answers.  That reading effort will save everybody involved some time, it will get you the answers you need more quickly, and (more subtly) it'll help you in your career development; simply knowing how to ask good questions can be key to advancement and job promotions.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Mar 2009 13:22:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/4374609#M93763</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2009-03-11T13:22:43Z</dc:date>
    </item>
  </channel>
</rss>

