<?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: Typing Logfiles in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051550#M37979</link>
    <description>What's COBOL for (C's) fflush() or (RMS's)&lt;BR /&gt;$FLUSH?</description>
    <pubDate>Wed, 06 Jun 2007 11:10:41 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2007-06-06T11:10:41Z</dc:date>
    <item>
      <title>Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051549#M37978</link>
      <description>Good Morning,&lt;BR /&gt;&lt;BR /&gt;I have a developer who's written a service using Cobol on OpenVMS.  When this program was written in C and was a background process, the logfile could be typed out without a problem so the data could be viewed.  Now that we've rewritten it in Cobol as a service that is picking up messages from a Websphere MQ Queue, we're having problems doing this.  Options we've been given are to Close and then Open the file in Extend mode every so many records or reduce the disk cluster size so the allocated log file blocks will be filled sooner and can be typed.&lt;BR /&gt;&lt;BR /&gt;Both of these options seem way too extreme.  Does anybody have an easier solution as to how we may accomplish this?&lt;BR /&gt;&lt;BR /&gt;Thoughts and advise are much appreciated.&lt;BR /&gt;&lt;BR /&gt;Wanda&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 11:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051549#M37978</guid>
      <dc:creator>Wanda Ravenscroft</dc:creator>
      <dc:date>2007-06-06T11:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051550#M37979</link>
      <description>What's COBOL for (C's) fflush() or (RMS's)&lt;BR /&gt;$FLUSH?</description>
      <pubDate>Wed, 06 Jun 2007 11:10:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051550#M37979</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-06-06T11:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051551#M37980</link>
      <description>I'm being told we have a SYS$FLUSH command.  This was the format of the command:&lt;BR /&gt;&lt;BR /&gt;CALL "SYS$FLUSH" USING BY VALUE THE_POINTER_TO_THE_RAB</description>
      <pubDate>Wed, 06 Jun 2007 11:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051551#M37980</guid>
      <dc:creator>Wanda Ravenscroft</dc:creator>
      <dc:date>2007-06-06T11:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051552#M37981</link>
      <description>Wanda&lt;BR /&gt;&lt;BR /&gt;You may be interested by the trick detailed by John Gillings in this thread&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=629558" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=629558&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;which lets you view the logfile.</description>
      <pubDate>Wed, 06 Jun 2007 11:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051552#M37981</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2007-06-06T11:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051553#M37982</link>
      <description>Hi Wanda,&lt;BR /&gt;    It looks like your doing your own rms open. check the fab. check that fab$b_shr has fab$v_shrget set. look at the rms manual for $open, there may be others. look also at $update $write. if the C code did&lt;BR /&gt;its own open, check what settings it has&lt;BR /&gt;for rms bits. Hope this helps -Dean</description>
      <pubDate>Wed, 06 Jun 2007 12:47:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051553#M37982</guid>
      <dc:creator>Dean McGorrill</dc:creator>
      <dc:date>2007-06-06T12:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051554#M37983</link>
      <description>Wanda,&lt;BR /&gt;&lt;BR /&gt;My leading suspect would be that the file is opened for exclusive use. Without looking at the code, it is hard to be precise.&lt;BR /&gt;&lt;BR /&gt;Certainly, ensuring that the file is opened for sharing (admittedly with a single writer), and flushing the buffers on a periodic (timed) basis (timers and ASTs are excellent for this to simplify the logic, as I have mentioned in my DECUS presentations on using the AST facility), should allow use of the TYPE command to display the file (as you already do for batch jobs).&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>Wed, 06 Jun 2007 14:19:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051554#M37983</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-06-06T14:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051555#M37984</link>
      <description>An OPEN/READ/SHARE/WRITE command has resolved the DCL part of our problem.  I'm thinking the SYS$FLUSH will solve the COBOL part of our problem, but we don't have a good example to go by and the HELP isn't providing any good examples on how this is used.  Can anybody provide an example on how we would go about using SYS$FLUSH?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Wanda&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 14:31:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051555#M37984</guid>
      <dc:creator>Wanda Ravenscroft</dc:creator>
      <dc:date>2007-06-06T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051556#M37985</link>
      <description>I don't know cobol, but in basic it would look something like...&lt;BR /&gt;&lt;BR /&gt;status% = sys$flush(RAB by ref,[err by ref],[suc by ref])&lt;BR /&gt;&lt;BR /&gt;where err and suc would be optional completion routines. status would have&lt;BR /&gt;the return status (r0) also located in&lt;BR /&gt;the rab, rab$l_sts. hope this helps!</description>
      <pubDate>Wed, 06 Jun 2007 15:16:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051556#M37985</guid>
      <dc:creator>Dean McGorrill</dc:creator>
      <dc:date>2007-06-06T15:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051557#M37986</link>
      <description>Haven't tried this specific case in COBOL, but the following is where I would dig...&lt;BR /&gt;&lt;BR /&gt;If the log file is opened for shared read, you should not have to deal with the log flush operation -- this is very likely what the C code was doing.  (Details of sharing output log files in C are over in the FAQ.)  As for your case here, I'd probably look for and try something like OPEN OUTPUT mumble WITH LOCK ALLOWING READERS mumble -- or some such -- in your existing procedure division?  When sharing is turned on, RMS deals also with the stuff in flight for you. &lt;BR /&gt;&lt;BR /&gt;The brute-force option is to have the COBOL code call the (working) C code for its log I/O.  That's certainly feasible.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 16:45:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051557#M37986</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-06-06T16:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051558#M37987</link>
      <description>Hi Wanda,&lt;BR /&gt;&lt;BR /&gt;Just checking that: -&lt;BR /&gt;"When this program was written in C and was a background process,"&lt;BR /&gt;&lt;BR /&gt;was the log file of which you speak the sys$output of the background process? (and now it's not?)&lt;BR /&gt;&lt;BR /&gt;Otherwise, what did the C declaration look like?&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 17:41:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051558#M37987</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2007-06-06T17:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051559#M37988</link>
      <description>Wanda,&lt;BR /&gt;&lt;BR /&gt;  You don't need an explicit FLUSH, you just need to open the file from COBOL allowing shared write access. This is not the default. Something like:&lt;BR /&gt;&lt;BR /&gt;OPEN OUTPUT yourfile ALLOWING WRITERS.&lt;BR /&gt;&lt;BR /&gt;(not sure if "WITH LOCK" is required).&lt;BR /&gt;&lt;BR /&gt;Now when another process opens the file with write intent, RMS will force your COBOL process to flush the output and update the EOF. The advantage is the output is always up to date when you want it, but work is only done when required, rather than a periodic flush, where you do more work than necessary, and still have a potential latency.&lt;BR /&gt;&lt;BR /&gt;If you do want/need to perform direct RMS functions on COBOL files, you can obtain the RAB and/or FAB in a supported (but, obviously, not portable) manner using routines DCOB$RMS_CURRENT_RAB or DCOB$RMS_CURRENT_FAB. See Appendix E of the COBOL Reference Manual for details.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 17:43:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051559#M37988</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-06-06T17:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051560#M37989</link>
      <description>Hi Wanda,&lt;BR /&gt;&lt;BR /&gt;[ Fancy meeting you here !]&lt;BR /&gt;I'm 99% sure to be in STL early next week, so we can go over some optionss.&lt;BR /&gt;&lt;BR /&gt;The easiest way to go really is to 'allowing readers' in Cobol, that shoudl be all that is needed. Be sure to apply deferred write otherwise you'll get an IO per display.&lt;BR /&gt;&lt;BR /&gt;Cobol is likely to use non-record IO for noshared output, in which case the SYS$FLUSH trick you are considering will not work.&lt;BR /&gt;&lt;BR /&gt;Still, if you want example of getting to a RAB from Cobol and using them froa SYS$FLUSH call then check out my directories on VRXDEV::[DIGITAL.HEIN]. There are probably examples floating around from last year (LOCK.COB? UNSHIP.COB?)&lt;BR /&gt;&lt;BR /&gt;My Cobol trace tool (Bob H!) may help to see some gory details if needed.&lt;BR /&gt;&lt;BR /&gt;Did you already try CONVERT/SHARE to see the data?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Jun 2007 19:39:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051560#M37989</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-06-06T19:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Typing Logfiles</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051561#M37990</link>
      <description>Thank-you to everyone for your responses.  Responses received by Hein van den Heuval and Labadie were the answers.  We had to put an open/read/share/write in the DCL and we had to use the sys$flush in the Cobol.  Additional thanks to Hein for stopping by while at the office and talking with us personally with some addtional suggestions and looking at what we were dealing with.  Much appreciated.&lt;BR /&gt;&lt;BR /&gt;Wanda&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Jun 2007 15:36:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/typing-logfiles/m-p/5051561#M37990</guid>
      <dc:creator>Wanda Ravenscroft</dc:creator>
      <dc:date>2007-06-29T15:36:02Z</dc:date>
    </item>
  </channel>
</rss>

