<?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 optimize subroutine placement in DCL in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097472#M43484</link>
    <description>Wim&lt;BR /&gt;&lt;BR /&gt;May be you should have 2 differents versions of your scripts, the actual and another one for the Vms versions allowing Pipe.&lt;BR /&gt;&lt;BR /&gt;As you seem to look at some memory cells, you could use the same idea as in this procedure&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dcl.openvms.org/stories.php?story=06/03/21/8098045" target="_blank"&gt;http://dcl.openvms.org/stories.php?story=06/03/21/8098045&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I have in my notes the sda commands to get various things, for npagedyn pool expansion see the previous procedure.&lt;BR /&gt;&lt;BR /&gt;I bet Volker Halle will have posted how to get the number of used slots and such things before I find my notes !</description>
    <pubDate>Tue, 18 Mar 2008 11:15:06 GMT</pubDate>
    <dc:creator>labadie_1</dc:creator>
    <dc:date>2008-03-18T11:15:06Z</dc:date>
    <item>
      <title>How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097451#M43463</link>
      <description>Test1 : 10000 gosub x. x is directly after the gosub code. Result : 3933 direct IO's.&lt;BR /&gt;&lt;BR /&gt;Test2 : idem but x is 4200 lines of DCL down the script. Result : 23947 IO's. CPU went up by 15% compared with test 1.&lt;BR /&gt;&lt;BR /&gt;It didn't read the DCL procedure 10000 times. What is the algorithme of the caching / reading / searching DCL ?&lt;BR /&gt;&lt;BR /&gt;Wim&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Mar 2008 15:27:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097451#M43463</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-12T15:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097452#M43464</link>
      <description>x is directly after the gosub code. &lt;BR /&gt;&lt;BR /&gt;must be&lt;BR /&gt;x is directly after the gosub call.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Wed, 12 Mar 2008 15:34:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097452#M43464</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-12T15:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097453#M43465</link>
      <description>Did those IOs turn into real disk reads or did XFC have them in cache?</description>
      <pubDate>Wed, 12 Mar 2008 15:51:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097453#M43465</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2008-03-12T15:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097454#M43466</link>
      <description>I'm not certain exactly what your question is, but I can confirm that in a very-long DCL command procedure there is a very signficant performance advantage to putting a GOSUB routine close to the corresponding GOSUB statements, even if you have to branch around the GOSUB routine with an ugly "GOTO label" before it and "label:" after it.&lt;BR /&gt;&lt;BR /&gt;If the GOSUB routine is at the bottom of a long command procedure DCL apparently re-reads the entire procedure with every GOSUB statment in order to find the GOSUB label.  My guess is that DCL only caches x number of statement labels.</description>
      <pubDate>Wed, 12 Mar 2008 15:52:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097454#M43466</guid>
      <dc:creator>Jess Goodman</dc:creator>
      <dc:date>2008-03-12T15:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097455#M43467</link>
      <description>The IO was satisfied by VIOC. Will test on Monday with XFC.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Wed, 12 Mar 2008 16:00:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097455#M43467</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-12T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097456#M43468</link>
      <description>Wim,&lt;BR /&gt;&lt;BR /&gt;Stating the bleeding obvious...&lt;BR /&gt;&lt;BR /&gt;If you want optimized code, use an optimizing compiler, NOT DCL.&lt;BR /&gt;&lt;BR /&gt;DCL has some syntactic peculiarities that mean it isn't possible to just record the location of every label for easy jumping. Nature of the beast. Ever seen a dynamic label? It's perfectly legal syntax and works "mostly" as you'd expect. Also consider IF THEN ELSE scoping, SUBROUTINES, forward and backward references and potential duplicates. Again, this is the nature of an unstructured, untyped, interpreted language.&lt;BR /&gt;&lt;BR /&gt;IMHO 4000 lines of DCL in a single procedure is insane. Restructure it into multiple procedures for better performance, and easier debugging (simple experiment, find an ENDIF statement after the first 100 or so lines, remove the leading "$" and see how long it takes your best DCL programmer to find the bug).&lt;BR /&gt;&lt;BR /&gt;DCL is a fine language for some things, but when you find yourself banging up against its inherent limitations, it's time to reimplement your program in a more appropriate language.</description>
      <pubDate>Wed, 12 Mar 2008 20:15:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097456#M43468</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-03-12T20:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097457#M43469</link>
      <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; What is the algorithme of the caching / reading / searching DCL ?&lt;BR /&gt;&lt;BR /&gt;DCL remembers RMS RFA's for labels, so it can tell RMS to 'jump' to the right spot.&lt;BR /&gt;&lt;BR /&gt;DCL uses RMS in Process IO context with a single buffer of an OpenVMS version dependent size. In my case (Alpha 8.3) that was 4096 bytes.&lt;BR /&gt;&lt;BR /&gt;If the calling line and ENTIRE call/gosub code executed is not it the same buffer, then read IOs will happen.&lt;BR /&gt;&lt;BR /&gt;So just go see for yourself what it does!&lt;BR /&gt;Start op two sessions:&lt;BR /&gt;1: &lt;BR /&gt;$SET PROC/NAME=TEST&lt;BR /&gt;$@TEST&lt;BR /&gt;&lt;BR /&gt;2:&lt;BR /&gt;$SET PROC/PRIV=CMKRNL&lt;BR /&gt;$ANALYZE/SYSTEM&lt;BR /&gt;SDA&amp;gt; SET PROC TEST&lt;BR /&gt;SDA&amp;gt; SHOW PROC/RMS=(PIO,NOIFB:3,RAB,BDBSUM)&lt;BR /&gt;&lt;BR /&gt;Suggested test.com (verbatim!):&lt;BR /&gt;&lt;BR /&gt;$  Loop:&lt;BR /&gt;$  Read/promt="Go Far? " sys$command x&lt;BR /&gt;$  if x&lt;BR /&gt;$  then gosub far&lt;BR /&gt;$ eLse gosub near&lt;BR /&gt;$ endif&lt;BR /&gt;$ goto loop&lt;BR /&gt;$ near:&lt;BR /&gt;$ read/prompt="Return from near? " sys$command x&lt;BR /&gt;$ return&lt;BR /&gt;$ x=1 !The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.&lt;BR /&gt;$ x=1 !The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.&lt;BR /&gt;:&lt;BR /&gt;&lt;REPEAT 100="" times=""&gt;&lt;BR /&gt;:&lt;BR /&gt;$ x=1 !The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.&lt;BR /&gt;$far:&lt;BR /&gt;$read/prompt="Return from far? " sys$command x&lt;BR /&gt;$return&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For bonus appreciation and learning, convert the above to an INDEXED files. (Spelling Magic involved here!). &lt;BR /&gt;&lt;BR /&gt;$ conv/fdl="fil; org ind; key 0; dup yes; seg0_l 4" test.com test_idx.com&lt;BR /&gt;$ type test_idx.com&lt;BR /&gt;$ diff test.com test_idx.com&lt;BR /&gt;&lt;BR /&gt;Now try again.&lt;BR /&gt;&lt;BR /&gt;You'll see you get 2 buffers, each a bucket (default 2 blocks) big. But 1 of the buffers is used for the index root has a cache value keeping it there. Thus you'l get the same, or more, IOs depending on the exact fill of buckets.&lt;BR /&gt;&lt;BR /&gt;Are we having fun yet?&lt;BR /&gt;&lt;BR /&gt;groetjes,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;/REPEAT&gt;</description>
      <pubDate>Wed, 12 Mar 2008 23:02:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097457#M43469</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-12T23:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097458#M43470</link>
      <description>I wrote "verbatim!" to honor spaces and case, but I meant 'mostly verbatim' ;-)&lt;BR /&gt;(een beetje zwanger).&lt;BR /&gt;&lt;BR /&gt;The part with:&lt;BR /&gt;:&lt;BR /&gt;&lt;REPEAT 100="" times=""&gt;&lt;BR /&gt;:&lt;BR /&gt;&lt;BR /&gt;Is supposed to represent a bunch of the long lines where a bunch is larger than 50 such that we exceed 4000-ish bytes using 100 of those  35-letter pangrams + stuff.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;/REPEAT&gt;</description>
      <pubDate>Wed, 12 Mar 2008 23:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097458#M43470</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-12T23:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097459#M43471</link>
      <description>Same result with XFC (7.3). XFC prevents the IO's.&lt;BR /&gt;&lt;BR /&gt;John G.,&lt;BR /&gt;&lt;BR /&gt;The procedure is monitoring the systems and is running for 8 years without major problems. But it has very strict debugging built-in (1 warning and it aborts+restarts saying in which part it aborted -&amp;gt; maximum 100 lines of DCL are possible). The advantage is that ANY system manager can read/debug/modify it. In contrast with the pascal and fortran programs we have too. It also has the advantage that it doesn't create extra processes (I pase output of ncl, tcpip, ...). BTW : already found that subprocedures (@) and calls are more expensive than gosubs.&lt;BR /&gt;&lt;BR /&gt;So, no way I will go to a programming language.&lt;BR /&gt;&lt;BR /&gt;So, just trying to optimize my Fiat (or whatever small car you have is .au), not planning to buy a Mercedes.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 17 Mar 2008 06:41:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097459#M43471</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-17T06:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097460#M43472</link>
      <description>Still don't get it.&lt;BR /&gt;&lt;BR /&gt;Tried only 1 gosub. Directly after : 42 IO's. 4000 lines further : 56 IO's. The procedure is 248 blocks on disk. Did it read the entire procedure in about 10 IO's ?&lt;BR /&gt;&lt;BR /&gt;The gosub only contained return. So I would expect that read by RFA only requires 1 IO. Then why did I get a punishment of 20000 IO's in the original test ? 2 IO's for each RFA read ?&lt;BR /&gt;&lt;BR /&gt;And how to explain the 3933 IO's from test1 ? If it had to read something again, I would expect at least 10.000 IO's.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 17 Mar 2008 06:54:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097460#M43472</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-17T06:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097461#M43473</link>
      <description>Hmm, If you really care about understanding it then you should use the tools I outlined.&lt;BR /&gt;&lt;BR /&gt;But a few reads in the procedure to 'break', use a second screen to look.&lt;BR /&gt;&lt;BR /&gt;Be sure to run with SET WATCH/FILE/CLASS=MAJOR so see the final read/write IOs counted&lt;BR /&gt;Or pick up Volker's PROCIO. &lt;BR /&gt;I _think_ it will show the IOs counts as they happen, but it didn't work just now on my test system.&lt;BR /&gt;&lt;BR /&gt;You can also used ANALYZE/SYSTEM... SET PROC ... SHOW PROC/CHAN... READ SYSDEF ... FORMAT &lt;CCB&gt; ---&amp;gt; See read/write count. or go on to the FCB&lt;BR /&gt;&lt;BR /&gt;If you go backt o my earlier reply for the SHOW RMS hints, then you may want to know the RFAs for the labels, as teh first part is the BLOCK NUMBER.&lt;BR /&gt;&lt;BR /&gt;I use SEARCH/NUMB to get some relevant line numbers, then DUMP/RECOR=(COUNT=1,START=&lt;NUMBER&gt;) to get the RFA.&lt;BR /&gt;While in SDA&amp;gt;  the RAB will show the current RFA of course and an EXAMINE of the RBF will show the line it is on.&lt;BR /&gt;&lt;BR /&gt;Finally, it is critical how the executed lines fit in buffers.&lt;BR /&gt;If a label happens to be placed just before an buffer (8 block?) boundary, and the rest just on the other side, then you see lot's of IOs (cached) to flip back and forward.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;/NUMBER&gt;&lt;/CCB&gt;</description>
      <pubDate>Mon, 17 Mar 2008 10:31:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097461#M43473</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-17T10:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097462#M43474</link>
      <description>I learned - long ago (VAX?) - that looking for GOSUB and CALL targets, DCL will search the file top-to-bottom, and that, for speed, you should located them on top of the file. Search may start from the current location (of GSUB or CALL), but when not found, search for a label will still start on top of the file.&lt;BR /&gt;&lt;BR /&gt;I think it still works this way - because an error in DCL code between the GOSUB or CALL, and the target location, may halt the procedure.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Mar 2008 10:48:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097462#M43474</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2008-03-17T10:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097463#M43475</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;I tried your SDA stuff but it's rather technical : what exactly to watch for, what the fields mean).&lt;BR /&gt;&lt;BR /&gt;WIllem,&lt;BR /&gt;&lt;BR /&gt;I found that too.&lt;BR /&gt;&lt;BR /&gt;But I'm curious if there is a description in plain English of how it works.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 17 Mar 2008 12:30:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097463#M43475</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-17T12:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097464#M43476</link>
      <description>&lt;!--!*#--&gt;Wim, did you try the example I suggested?&lt;BR /&gt;&lt;BR /&gt;You'll find it very educational and not too hard to figure out.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; SHOW PROC/RMS=(PIO,NOIFB:3,RAB,BDBSUM)&lt;BR /&gt;&lt;BR /&gt;The PIO tells the code in RMS$SDA to report the PROCESS structures (DCL) not the IMAGE.&lt;BR /&gt;RAB is RAB... See RMS REFERENCE MANUAL.&lt;BR /&gt;BDBSUM is a Summary for the Buffer Descriptor Blocks. Internal RMS stuff.&lt;BR /&gt;&lt;BR /&gt;Here is quick sample run (on OpenVMS V8.3!)&lt;BR /&gt;"test session input highlighted with &amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;$ set proc/name=test&lt;BR /&gt;$ set promp="test&amp;gt;&amp;gt; "&lt;BR /&gt;test&amp;gt;&amp;gt; @test&lt;BR /&gt;&amp;gt;&amp;gt;Go Far? &lt;BR /&gt;&lt;BR /&gt;SDA&amp;gt; SHOW PROC/CHAN&lt;BR /&gt;:&lt;BR /&gt;Channel    CCB     Window     Status    File&lt;BR /&gt;  0020  7FF7C020  82420100              test.com&lt;BR /&gt;&lt;BR /&gt;SDA&amp;gt; READ SYSDEF&lt;BR /&gt;SDA&amp;gt; FORMAT 82420100 ! Window&lt;BR /&gt;:&lt;BR /&gt;FFFFFFFF.82420138   WCB$L_READS 00000001&lt;BR /&gt;:&lt;BR /&gt;SDA&amp;gt; SHOW PROC/RMS=(PIO,NOIFB:3,RAB,BDBSUM)&lt;BR /&gt;RAB Address:    7FFCF014&lt;BR /&gt;:&lt;BR /&gt;RFA:            00000001,000A&lt;BR /&gt;RBF:            7FF9FEA6&lt;BR /&gt;RSZ:            0026          38.&lt;BR /&gt;&lt;BR /&gt;So the first question came a record at offset 0xA in VBN 1.&lt;BR /&gt;To confirm:&lt;BR /&gt;SDA&amp;gt; exam 7FF9FEA6;26&lt;BR /&gt;%SDA-W-UNALIGNED, unaligned address 00000000.7FF9FEA6; converting to aligned address&lt;BR /&gt;CTER_C$  Read/promt="Go Far? " s     00000000.7FF9FEA0&lt;BR /&gt;ys$command x.mmand x.dog. The qu     00000000.7FF9FEC0&lt;BR /&gt;:&lt;BR /&gt;BDB/GBPB Summary&lt;BR /&gt;SIZE     NUMB     VBN    BLB_PTR       ADDR &lt;BR /&gt;00001000 00001000 00000001 00000000 000000007B0B3800&lt;BR /&gt;&lt;BR /&gt;So the buffer used by RMS for DCL was 0x1000 = 4096 bytes, and all were filled.&lt;BR /&gt;The current VBN is 1, as expected, and the buffer address some P1 zone. We can look at that buffer, which has raw disk block data:&lt;BR /&gt;&lt;BR /&gt;(Removed the HEX mumbo jumbo)&lt;BR /&gt;SDA&amp;gt; exa 000000007B0B3800;100&lt;BR /&gt;..$  Loop:&amp;amp;.$  Read/promt="Go Fa     00000000.7B0B3800&lt;BR /&gt;r? " sys$command x..$  if x ..$      00000000.7B0B3820&lt;BR /&gt; then gosub far...$ eLse gosub n     00000000.7B0B3840&lt;BR /&gt;&lt;BR /&gt;See? Every last bit can be seen and explained.&lt;BR /&gt;Now JUMP:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Go Far? y&lt;BR /&gt;&amp;gt;&amp;gt; Return from far?&lt;BR /&gt;&lt;BR /&gt;SDA&amp;gt; ex FFFFFFFF.82420138  ! WCB$L_READ&lt;BR /&gt;FFFFFFFF.82420138:  00000000.00000003&lt;BR /&gt;:&lt;BR /&gt;RAB&lt;BR /&gt;RFA:            00000014,0112&lt;BR /&gt;:&lt;BR /&gt;BDB/GBPB Summary&lt;BR /&gt;SIZE     NUMB     VBN    BLB_PTR       ADDR &lt;BR /&gt;00001000 00000800 00000011 00000000 000000007B0B3800&lt;BR /&gt;&lt;BR /&gt;Same buffer (address) now holds VBN 0x11 = 17 through VBN 0x14&lt;BR /&gt;Only 0x800 bytes where read, hitting EOF.&lt;BR /&gt;The RFA points to the last VBN in the buffer. To confirm:&lt;BR /&gt;SDA&amp;gt; exa 007B0B3800+(3*200)+112;40&lt;BR /&gt;%SDA-W-UNALIGNED, unaligned address 00000000.7B0B3F12; converting to aligned address&lt;BR /&gt;: ..$read/prompt="Return from fa     00000000.7B0B3F10&lt;BR /&gt;r? " sys$command x..$return.....     00000000.7B0B3F30&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Return from far? y&lt;BR /&gt;&amp;gt;&amp;gt;Go Far?&lt;BR /&gt;&lt;BR /&gt;Extra read done...&lt;BR /&gt;FFFFFFFF.82420138:  00000000.00000004 &lt;BR /&gt;And VBN 1 is back in the buffer.&lt;BR /&gt;&lt;BR /&gt;Clear as mud?&lt;BR /&gt;Very predictable!&lt;BR /&gt;&lt;BR /&gt;Now you have to realize that RMS when asked to 'jump' to a remembered label (or returning, or returning from an @), will &lt;BR /&gt;NOT read starting at that VBN. &lt;BR /&gt;It will start the read at its natural VBN buffer boundaries.&lt;BR /&gt;&lt;BR /&gt;It take the target VBN from the RFA (here x14, integer divide by block-in-buffer (here 8), and re-multiply by buffers size plus one (because oddly enough the first block is 1, not 0) giving 0x11 here. So if the code after the label takes more bytes than fit in that buffer, then an extra IO will be done every time again.&lt;BR /&gt;&lt;BR /&gt;In fact, the label record itself may require 2 read IOs on a bad day!&lt;BR /&gt;&lt;BR /&gt;Moving and changing 1 comment line from before a label to behind it could cause the label to be brought forward to that the start is just in the last bytes of one buffer, and push the return just over the end of the next buffer, changing 1 IO to 3.&lt;BR /&gt;... or visa versa.&lt;BR /&gt;&lt;BR /&gt;Far all who had the interest to read this far...&lt;BR /&gt;&lt;BR /&gt;1) Would an slow-motion rundown to show 'what happens behind the scenes' as above be a boot Camp Session you would attent?&lt;BR /&gt;&lt;BR /&gt;2) Think about sticking a DCL procedure in an indexed file. It would be ordered by key right? Well, I did not provide a handy key ina (fixed byte offset) comment fields, but just used the first 4 bytes as key. Do you see how it can work at all?&lt;BR /&gt;&lt;BR /&gt;Leuk? Leerzaam? Groetjes!&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Mar 2008 13:22:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097464#M43476</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-17T13:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097465#M43477</link>
      <description>@Hein:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;Far all who had the interest to read this far...&lt;BR /&gt;&lt;BR /&gt;1) Would an slow-motion rundown to show 'what happens behind the scenes' as above be a boot Camp Session you would attent?&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;Well, IF I manage to get there (and at this moment chances are slim), THEN I would love to see that!&lt;BR /&gt;(And if I can not make it, my guess is that at the next TUD it would also gather interest, certainly mine).&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;</description>
      <pubDate>Mon, 17 Mar 2008 13:37:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097465#M43477</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2008-03-17T13:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097466#M43478</link>
      <description>&lt;BR /&gt;Back to the underlying question.&lt;BR /&gt;"How to optimize subroutine placement in DCL"&lt;BR /&gt;&lt;BR /&gt;The answer we derived above is that for optimal speed the goal would be to have the caller, and callee live in the same RMS buffer when it comes to execution time.&lt;BR /&gt;&lt;BR /&gt;Now this is unrealistic / tedious / next to impossible to arrange.&lt;BR /&gt;&lt;BR /&gt;So the next best thing is to increase the odds.&lt;BR /&gt;That is basic commen sense for speeding up DCL, but rarely followed.&lt;BR /&gt;&lt;BR /&gt;Notably an easy win:&lt;BR /&gt;- restrict the 'documentation' at top to a referral pointing to the bottom.&lt;BR /&gt;&lt;BR /&gt;Or you could make the intro just over 4096 bytes long (counting overhead).&lt;BR /&gt;Of course I mean this 99% as a joke, but it could be a neat experiment. If the procedure has a clear 'main loop' for example for a 'main menu'. then use space lines comments to push that start into a fresh RMS buffer. Verify with $DUMP/BLO=(COUN=1,START=9)&lt;BR /&gt;&lt;BR /&gt;Other thoughts....&lt;BR /&gt;- Move all usage and maintenance comments to the very bottom, behind rarely executed ('help') routines.&lt;BR /&gt;&lt;BR /&gt;- Consider a 'branch out' at the top to an 'init' section located towards the end and back there to the top.&lt;BR /&gt;&lt;BR /&gt;- Consider putting extensive logical name and symbol defintion in an executable program.&lt;BR /&gt;&lt;BR /&gt;- Keep callers and callees close. This could mean to NOT put all subroutines at the end, but sprinkeld amongst main logic.&lt;BR /&gt;&lt;BR /&gt;- Maintain 2 copies of a performance sensitive script:&lt;BR /&gt;1) main version, in CMS&lt;BR /&gt;2) executable version, trimmed down using a tool like 'DCLDIET' or 'SQUEEZE' to strip all comments, minimize whitespace, reduce lexical functions names to abbreviations, transform all variables to a0, a1,.. a9, aa, ab,.. az, b0, b1,...&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$! x.com first, lastname. Date. Version.&lt;BR /&gt;$! Full comments and usage at "README"&lt;BR /&gt;$goto setup &lt;BR /&gt;$main: &lt;BR /&gt;&lt;BR /&gt;:&lt;BR /&gt;goto part_'x&lt;BR /&gt;part_1:&lt;BR /&gt;:&lt;BR /&gt;goto main&lt;BR /&gt;:&lt;BR /&gt;subroutines for part 1 and part 2&lt;BR /&gt;:&lt;BR /&gt;part_2:&lt;BR /&gt;:&lt;BR /&gt;part_5:&lt;BR /&gt;:&lt;BR /&gt;other bunch of subroutines for notably for part_4 - part_7&lt;BR /&gt;:&lt;BR /&gt;part_z:&lt;BR /&gt;:&lt;BR /&gt;$setup:&lt;BR /&gt;:&lt;BR /&gt;$goto main ! Let's start for real now.&lt;BR /&gt;$&lt;BR /&gt;$help:&lt;BR /&gt;$type sys$input&lt;BR /&gt;&lt;BR /&gt;$!README&lt;BR /&gt;$exit&lt;BR /&gt;&lt;BR /&gt;blah blah.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Mar 2008 14:12:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097466#M43478</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-17T14:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097467#M43479</link>
      <description>Wim,&lt;BR /&gt;&lt;BR /&gt;  An "optimization" I've used for a large suite of DCL is to have the main entry point check the location of the files. If they're on a real disk drive, create a RAM disk, move all the procedures to it and reexecute the new copy from the RAM disk. This gave me about 15% speed up, even counting the work to setup and tear down the RAM disk. However, it was pre XFC, so your mileage may vary today.&lt;BR /&gt;&lt;BR /&gt;  Another real example... I had a task of parsing some data to gather statistics from several dozen large log files (&amp;gt;1.5GB each). I wrote a DCL prototype and found it was taking about 90 minutes per file. While it was running, I reimplemented the DCL in MACRO32. The MACRO version produced identical output to the DCL, but took less than 60 seconds per file. In this case the end to end runtime of the compiled version was significantly faster than the DCL, including the development, compilation and debugging of the compiled version!&lt;BR /&gt;&lt;BR /&gt;  I think sometimes the real potential difference between interpreted code and compiled code is not appreciated. I'd also argue that although DCL is more easily accessible, it's often MUCH harder to write and get it correct than Pascal, FORTRAN, MACRO32 or even C and Basic. It's a fallacy to think that "anyone can do it" when there are so many subtle pitfalls like the myriad of potential single character typos to break programs, and there's no compiler to protect you. Sure, it's great to be able to knock out a page or so of script to run once or twice, but when you're getting into thousands of lines of code, or something that needs frequent modification, or that runs all day, every day, it's well worth putting in the investement to do it properly in the most appropriate language for the task.&lt;BR /&gt;&lt;BR /&gt;That said, please don't get the wrong idea about my attitude to DCL. I write huge volumes of DCL, including procedures of several thousand lines, and even some that run all day, every day (but are not too performance sensitive). There are many things that can be done very easily in DCL that require lots of code in other languages (simple example, string subtraction!), BUT the DCL version often runs orders of magnitude slower.&lt;BR /&gt;&lt;BR /&gt;On the other hand, a DCL advantage in *favour* of performance is to use multiple pipes in order to automatically exploit multiple CPUs and avoid temporary files. I've got lots of DCL that forms itself into complex trees of pipes, with up to a dozen processes, each doing their own subtask. What I lose in process creation overhead, I often gain many times over in avoiding I/O to and from temporary files, and all the directory &amp;amp; file system overhead.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; It also has the advantage that it doesn't &lt;BR /&gt;&amp;gt;create extra processes (I pase output of &lt;BR /&gt;&amp;gt;ncl, tcpip, ...).&lt;BR /&gt;&lt;BR /&gt;On the contrary! I think you'll find that this could be a fruitful area of optimization. Get rid of all those temporary files! PIPE the output through SEARCH (compiled code, INSTALLed, and highly optimized by some of the best code cutters in the business, like Guy Peleg). Trim it down as much as possible, then back into your DCL parser. Yes it creates extra processes, but compare the overheads! These days avoiding disk I/O is your biggest bang for buck.&lt;BR /&gt; &lt;BR /&gt;The important thing is to realise when you're running up against the inherent limitations of the language (true regardless of what language you're using), and wasting your time trying to achieve a particular objective, when the real solution is to restructure or rewrite in a more appropriate language.</description>
      <pubDate>Mon, 17 Mar 2008 20:10:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097467#M43479</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-03-17T20:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097468#M43480</link>
      <description>&lt;!--!*#--&gt;John,&lt;BR /&gt;&lt;BR /&gt;$ if day1 .and. first_server&lt;BR /&gt;$ then&lt;BR /&gt;$    first_server="f"&lt;BR /&gt;$    gosub init_found&lt;BR /&gt;$    define/us sys$output 'ct_workf'&lt;BR /&gt;$    ucx show prot tcp/pa&lt;BR /&gt;$    open/read x 'ct_workf'&lt;BR /&gt;$r39:&lt;BR /&gt;$    read/end=e39 x x_rcd&lt;BR /&gt;$    x_rcd=f$ed(x_rcd,"compress")&lt;BR /&gt;$    it="Delay ACK:"&lt;BR /&gt;$    pos=f$loc(it,x_rcd)&lt;BR /&gt;$    if pos .ne. f$len(x_rcd)&lt;BR /&gt;$    then&lt;BR /&gt;$       f_1="t"&lt;BR /&gt;$       x_rcd2=f$extr(pos,80,x_rcd)&lt;BR /&gt;$       how=f$el(2," ",x_rcd2)&lt;BR /&gt;$       if f$extr(0,3,how) .nes. "dis"&lt;BR /&gt;$       then&lt;BR /&gt;$          call wms 'E' "TCP prot param ''it' must be disabled on Sybase nodes !"&lt;BR /&gt;$       endif&lt;BR /&gt;$       goto e39&lt;BR /&gt;$    endif&lt;BR /&gt;$    goto r39&lt;BR /&gt;$e39:&lt;BR /&gt;$    close x&lt;BR /&gt;$    del 'ct_workf'.*&lt;BR /&gt;$    if .not. f_1&lt;BR /&gt;$    then&lt;BR /&gt;$       call wms "W" "Output scan failed for ucx show prot tcp /pa"&lt;BR /&gt;$    endif&lt;BR /&gt;$ endif&lt;BR /&gt;&lt;BR /&gt;This is an example of the code. As you can see there is protection against the item "delay ack" not found. I know I can nest mere lexicals but I don't do that for readability. If something goes wrong, I still have the workfile to see what went wrong.&lt;BR /&gt;&lt;BR /&gt;BTW : the monitoring consumes 10 cpu sec per hour and 5000 DIO (pitty that the real IO's are not available in acc). This wile hundreds of checks are done, including a full disk scan for version &amp;gt;30.000.&lt;BR /&gt;&lt;BR /&gt;BTW2 : 1 version running on 5.5, 6.2, 7.2, 7.3. Only the last 2 remain. Thus piping could not be used.&lt;BR /&gt;&lt;BR /&gt;BTW3 : I said ANY system manager. ANY system manager should know basic DCL. What I can't say of C, FORTRAN or PASCAL (I'm a COBOL guy). And the ideal programming language changes every 10 years. &lt;BR /&gt;&lt;BR /&gt;For me the performance is acceptable. But if I can improve it ...&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Tue, 18 Mar 2008 06:42:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097468#M43480</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-18T06:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097469#M43481</link>
      <description>Wim&lt;BR /&gt;&lt;BR /&gt;If you just want to check if delay ack is enabled or disabled, may be it is faster to do, after the creation of your file&lt;BR /&gt;$    define/us sys$output 'ct_workf'&lt;BR /&gt;$    ucx show prot tcp/pa&lt;BR /&gt; &lt;BR /&gt;$ conv /fdl=sys$input 'ct_workf' new&lt;BR /&gt; record; format stream;&lt;BR /&gt;ctrl Z&lt;BR /&gt;so the file created is no longer a one-long-line file.&lt;BR /&gt;&lt;BR /&gt;Then a &lt;BR /&gt;$ sea new "Delay ACK",enabled/match=and&lt;BR /&gt;and branch according to the result of the search.&lt;BR /&gt;&lt;BR /&gt;The convert is necessary, because as window scale is enabled, you will always find the 2 strings (Delay ACK and enabled) without the convert.&lt;BR /&gt;&lt;BR /&gt;Really a pity that with your versions of Vms, you can't have the same procedure on all nodes, as using Pipe heavily (as John Gillings said) would save a lot.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Mar 2008 08:03:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097469#M43481</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2008-03-18T08:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to optimize subroutine placement in DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097470#M43482</link>
      <description>Labadie,&lt;BR /&gt;&lt;BR /&gt;Compared the 2 in batch :&lt;BR /&gt;&lt;BR /&gt;DCL : 95 DIO, .17 cpu, 1679 PF&lt;BR /&gt;Convert : 97 DIO, .19 CPU, 2371 PF&lt;BR /&gt;&lt;BR /&gt;With set file/at=rfm=stm instead of convert (is what I use in my dcl)&lt;BR /&gt;78 DIO, .16 CPU, 1768 PF&lt;BR /&gt;&lt;BR /&gt;And most of the code searches for many things and I want to know for each item if it was found or not. DCL will be difficult to beat.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Tue, 18 Mar 2008 10:12:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-optimize-subroutine-placement-in-dcl/m-p/5097470#M43482</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-03-18T10:12:05Z</dc:date>
    </item>
  </channel>
</rss>

