<?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: COBOL EOF Processing and the START Command in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067649#M38431</link>
    <description>Paul, you are right. When specifying manual locking and not using READ WITH LOCK, there should be no record locked. &lt;BR /&gt;&lt;BR /&gt;The 'natural' way to use RMS is automatic locking. The not-locking is actually implemented with the ROP=NLK and tells RMS to unlock the record right after it got it, and before returning to the user code.&lt;BR /&gt;&lt;BR /&gt;If you were SET FILE/STAT on the test file, and watch your program with ANAL/SYS... SHOW PROC/RMS=FSB, then you would see an equal number of ENQueues and DEQueues.&lt;BR /&gt;&lt;BR /&gt;But on the first "start dtmaster key &amp;lt;= dt-code" there is no DEQ and the last record in the file is left locked (RFA=3,1 as it is the first record inserted in the reproducer).&lt;BR /&gt;&lt;BR /&gt;I _suspect_, but this is a stretch/gamble, that that's caused by the internal rtl routine 'set_filepos' which does an rab-&amp;gt;rab$v_rrl = 1, without rab-&amp;gt;rab$v_nlk = 1, where mostly those need to go hand in hand. &lt;BR /&gt;&lt;BR /&gt;This could leave a record locked, which down the road would cause an OK_ALK which is pretty much an alternate succes status which is not tested for in the internal routines. Externally it is mapped to "00".&lt;BR /&gt;&lt;BR /&gt;Now the root cause for the problem itself would almost have to be in the cobol read-prior cause, not knowing to deal with ALK which building its RFA cache. (ALK could be legit after all). &lt;BR /&gt;&lt;BR /&gt;What's all that mumbo jumbo you say?&lt;BR /&gt;&lt;BR /&gt;Well, RMS does not offer read prior sequential. It does offer a read keyed reverse. But if there are duplicates, that would not work. Cobol itself, not rms, protects against that by building an array of records to walk back through. The re-allocation of that array is likely what pops VM... but it should not get there (there are no dups!).&lt;BR /&gt;&lt;BR /&gt;I'll ping our friend John R in OpenVMS Engineering a pointer to this topic, in case he has not spotted it already. He is likely to desire/appreciate a formal problem report though.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Sun, 09 Sep 2007 19:40:23 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-09-09T19:40:23Z</dc:date>
    <item>
      <title>COBOL EOF Processing and the START Command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067646#M38428</link>
      <description>&lt;!--!*#--&gt;Is there something â  specialâ   about how COBOL processing end of file under OpenVMS? I have ran into this reproducible issue and I am not sure at all if it is ignorance on my part, if I have something loaded into the system causing it (RAID, Apache, etc.) or if it is â  normalâ   behavior for HP COBOL. &lt;BR /&gt;&lt;BR /&gt;Sample code duplicating the issue is attached. &lt;BR /&gt;&lt;BR /&gt;Here are the details&lt;BR /&gt;&lt;BR /&gt;This file is normally used with random reads to validate codes key-entered by users in various screens. However, there are maintenance screens where a user can walk through the file record by record and choose to edit, delete, or add new records. Nothing unusual or the least bit tricky, stuff we all have done thousands of times. &lt;BR /&gt;&lt;BR /&gt;During maintenance processing, if the user encounter's end of file, the code merely sets an 88 level entry (EOF) to true. If a READ NEXT request is sent from the user, and EOF is true, no read will be attempted, the maint&lt;BR /&gt;program merely displays a message like "at end of file" and returns. This appears to work great.&lt;BR /&gt;&lt;BR /&gt;Of course, the user can, at any point, request a read of the previous record, which is then processed in a similar way. If EOF is detected in a READ PREVIOUS, an 88-level entry (BOF) is set to true, and subsequent READ PREVIOUS requests will not attempt to perform a real read. &lt;BR /&gt;&lt;BR /&gt;In both the read-next and read-prev subroutines, there is a check for the opposite condition. Again, nothing odd or tricky. If the read-next processing detects a BOF, it will perform a start on the file like this: &lt;BR /&gt;    move spaces to dt-code&lt;BR /&gt;    start dtmaster key &amp;gt;= dt-code    .... (with appropriate invalid key checking of course)&lt;BR /&gt;&lt;BR /&gt;If the read-prev processing detects an EOF condition, it attempts the corresponding action, &lt;BR /&gt;    (the value of dt-code here is the key value from the last record in the file)&lt;BR /&gt;    start dtmaster key &amp;lt;= dt-code    .... (with appropriate invalid key checking of course)&lt;BR /&gt;&lt;BR /&gt;This all works as expected until the second time an EOF is processed, at which point the &lt;BR /&gt;"start dtmaster key &amp;lt;= dt-code" will catastrophically fail. There is a long pause&lt;BR /&gt;and the following error message is produced.  &lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="-2"&gt;&lt;PRE&gt;&lt;BR /&gt;Reading Previous Record&lt;BR /&gt;%DEBUGBOOT-W-EXQUOTA, process quota exceeded&lt;BR /&gt;%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=000000007345&lt;BR /&gt;7EB0, PC=000000007C324940, PS=0000001B&lt;BR /&gt;&lt;BR /&gt;  Improperly handled condition, image exit forced.&lt;BR /&gt;    Signal arguments:   Number = 0000000000000005&lt;BR /&gt;                        Name   = 000000000000000C&lt;BR /&gt;                                 0000000000000000&lt;BR /&gt;                                 0000000073457EB0&lt;BR /&gt;                                 000000007C324940&lt;BR /&gt;                                 000000000000001B&lt;BR /&gt;    Register dump:&lt;BR /&gt;    R0  = 0000000000000000  R1  = 0000000000000000  R2  = 000000007C347180&lt;BR /&gt;    R3  = 0000000000050C40  R4  = 00000000000A5468  R5  = 000000007C3383B0&lt;BR /&gt;    R6  = 000000007AE25918  R7  = 00000000000A5998  R8  = 0000000000018039&lt;BR /&gt;    R9  = 0000000000018029  R10 = 0000000000018011  R11 = 0000000000000001&lt;BR /&gt;    R12 = 0000000000000006  R13 = 0000000000003030  R14 = 0000000000000000&lt;BR /&gt;    R15 = 0000000000000000  R16 = 000000000000002E  R17 = 00000000000A5536&lt;BR /&gt;    R18 = 0000000000000006  R19 = 0000000000000004  R20 = 0000000000000004&lt;BR /&gt;    R21 = 0400000000000000  R22 = 0000000000000000  R23 = 0000006400000000&lt;BR /&gt;    R24 = 0000000000000001  R25 = 0000000000000005  R26 = 0000000073458E80&lt;BR /&gt;    R27 = 0000000073457EB0  R28 = 0000000000000000  R29 = 0000000073458EB0&lt;BR /&gt;    SP  = 0000000073458EB0  PC  = 000000007C324940  PS  = 300000000000001B&lt;BR /&gt;&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The file is defined thusly:&lt;BR /&gt;&lt;BR /&gt;FILE-CONTROL.&lt;BR /&gt;     SELECT DTMASTER&lt;BR /&gt;       ASSIGN                 TO DYN-FILE-NAME&lt;BR /&gt;       ORGANIZATION           IS INDEXED&lt;BR /&gt;       ACCESS MODE            IS DYNAMIC&lt;BR /&gt;       RECORD KEY             IS DT-CODE&lt;BR /&gt;       LOCK MODE              IS MANUAL WITH LOCK ON MULTIPLE RECORDS&lt;BR /&gt;       FILE STATUS            IS DT-MASTER-STATUS.&lt;BR /&gt;&lt;BR /&gt;FD DTMASTER  VALUE OF ID IS DYN-FILE-NAME.&lt;BR /&gt;01 DT-RECORD.&lt;BR /&gt;   05 DT-CODE                           PIC X(6).&lt;BR /&gt;   05 DT-DESCRIPTION                    PIC X(40).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;---------------------------&lt;BR /&gt;I worked around this problem with a jury rigged solution I am not happy with at all. &lt;BR /&gt;In the read-prev processing with the suspected start, I replaced the start with an indexed&lt;BR /&gt;read of the last record, since the value of the record when EOF was detected is preserved. &lt;BR /&gt;I left the start in the BOF which always works as expected without a failure.&lt;BR /&gt;&lt;BR /&gt;I am very suspicious I have just coded something wrong, but similar code does work on other platforms, &lt;BR /&gt;so maybe not. The code is terribly over commented at this point, and also has some displays in it to&lt;BR /&gt;make the problem very obvious.&lt;BR /&gt;&lt;BR /&gt;In any case, thanks for taking the time to look. :) &lt;BR /&gt;&lt;BR /&gt;-Paul&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Sep 2007 12:15:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067646#M38428</guid>
      <dc:creator>Paul Raulerson</dc:creator>
      <dc:date>2007-09-09T12:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL EOF Processing and the START Command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067647#M38429</link>
      <description>&lt;!--!*#--&gt;Hello (again) Paul.&lt;BR /&gt;&lt;BR /&gt;The program dies with a VM quota error, but the problem is triggered through locking.&lt;BR /&gt;&lt;BR /&gt;This can be seen with a nicely with SHOW PROC/CONT. Hit 'q' to switch to the quota screen and just before dying you'll get something like:&lt;BR /&gt;&lt;BR /&gt; ASTs remaining           246/250   ( 98%)&lt;BR /&gt; Timer entries remaining   10/10    (100%)&lt;BR /&gt; PGFL quota count/limit     0/32000 (  0%)&lt;BR /&gt; ENQ quota count/limit   1999/2000  ( 99%)&lt;BR /&gt;&lt;BR /&gt;A simple ^T will of course also reveal a high PageFault rate, and Memory accumulation.&lt;BR /&gt;&lt;BR /&gt;The Cobol RTL seems a little confuseed, possibly due to the condition:&lt;BR /&gt;%RMS-S-OK_ALK, record is already locked&lt;BR /&gt;&lt;BR /&gt;Using SET PROC/SSL=STATE=ON and a little post processing we see the program end with:&lt;BR /&gt;&lt;BR /&gt;13:35:43.05 00018039 U SYS$RMS_FIND  RMS&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00018039 U SYS$RMS_GET   RMS&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000001 K SYS$CRETVA_64 SYS$VM&lt;BR /&gt;13:35:43.05 00018039 U SYS$RMS_GET   RMS&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;13:35:43.05 00018039 U SYS$RMS_FIND  RMS&lt;BR /&gt;13:35:43.05 00000689 E SYS$$ENQ      LOCKING&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The easiest WORKAROUND is to comment out the manual lock holding.&lt;BR /&gt;&lt;BR /&gt;       "lock mode              is manual with lock on multiple records."&lt;BR /&gt;&lt;BR /&gt;Of course this might not be acceptable for the real usage.&lt;BR /&gt;&lt;BR /&gt;The next best workaround is to toss in an &lt;BR /&gt;" unlock dtmaster. " before the crater read.&lt;BR /&gt;In the real code, an unlock all when hitting EOF or BOF may well be reasonable.&lt;BR /&gt;&lt;BR /&gt;Looks like you found a bug, mostly likely in the COBRTL.&lt;BR /&gt;&lt;BR /&gt;Great reproducer! It failed for me on OpenVMS 8.3 Itanium, Cobol V2.8-1444.&lt;BR /&gt;&lt;BR /&gt;I would urge to report this to HP Support.&lt;BR /&gt;&lt;BR /&gt;Hope this helps some, maybe more later...&lt;BR /&gt;&lt;BR /&gt;Hein van den Heuvel (at gmail dot com)&lt;BR /&gt;HvdH Performance Consulting&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Sep 2007 13:04:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067647#M38429</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-09-09T13:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL EOF Processing and the START Command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067648#M38430</link>
      <description>Hi Hein- &lt;BR /&gt; Well, I thought that manual locking was just that, so I am a bit confused over why the system would be locking records I did not tell it to. Must have something to do with the EOF status. &lt;BR /&gt;&lt;BR /&gt; I guess I should have put the compiler version in here, but I am glad you duplicated it on Itanium! &lt;BR /&gt;&lt;BR /&gt;Compiler: VMS 8.3 Alpha with 0300 patch levels,  Compaq COBOL V2.8-1286.&lt;BR /&gt;&lt;BR /&gt;-Paul&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Sep 2007 15:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067648#M38430</guid>
      <dc:creator>Paul Raulerson</dc:creator>
      <dc:date>2007-09-09T15:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL EOF Processing and the START Command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067649#M38431</link>
      <description>Paul, you are right. When specifying manual locking and not using READ WITH LOCK, there should be no record locked. &lt;BR /&gt;&lt;BR /&gt;The 'natural' way to use RMS is automatic locking. The not-locking is actually implemented with the ROP=NLK and tells RMS to unlock the record right after it got it, and before returning to the user code.&lt;BR /&gt;&lt;BR /&gt;If you were SET FILE/STAT on the test file, and watch your program with ANAL/SYS... SHOW PROC/RMS=FSB, then you would see an equal number of ENQueues and DEQueues.&lt;BR /&gt;&lt;BR /&gt;But on the first "start dtmaster key &amp;lt;= dt-code" there is no DEQ and the last record in the file is left locked (RFA=3,1 as it is the first record inserted in the reproducer).&lt;BR /&gt;&lt;BR /&gt;I _suspect_, but this is a stretch/gamble, that that's caused by the internal rtl routine 'set_filepos' which does an rab-&amp;gt;rab$v_rrl = 1, without rab-&amp;gt;rab$v_nlk = 1, where mostly those need to go hand in hand. &lt;BR /&gt;&lt;BR /&gt;This could leave a record locked, which down the road would cause an OK_ALK which is pretty much an alternate succes status which is not tested for in the internal routines. Externally it is mapped to "00".&lt;BR /&gt;&lt;BR /&gt;Now the root cause for the problem itself would almost have to be in the cobol read-prior cause, not knowing to deal with ALK which building its RFA cache. (ALK could be legit after all). &lt;BR /&gt;&lt;BR /&gt;What's all that mumbo jumbo you say?&lt;BR /&gt;&lt;BR /&gt;Well, RMS does not offer read prior sequential. It does offer a read keyed reverse. But if there are duplicates, that would not work. Cobol itself, not rms, protects against that by building an array of records to walk back through. The re-allocation of that array is likely what pops VM... but it should not get there (there are no dups!).&lt;BR /&gt;&lt;BR /&gt;I'll ping our friend John R in OpenVMS Engineering a pointer to this topic, in case he has not spotted it already. He is likely to desire/appreciate a formal problem report though.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Sep 2007 19:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067649#M38431</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-09-09T19:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: COBOL EOF Processing and the START Command</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067650#M38432</link>
      <description>Ah- actually that makes absolutely perfect sense, even if I am not all that familar yet with the internals of RMS processing. &lt;BR /&gt;&lt;BR /&gt;At least I don't feel quite so stupid. I originaly caught it because I am using the regression test checklists to validate ported code, but just figured I had fat fingered a line of code or something. &lt;BR /&gt;&lt;BR /&gt;I've really got to learn more about RMS; you found and validated in a few minutes what I spent several hours convincing myself was real. ;) &lt;BR /&gt;&lt;BR /&gt;-Paul&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Sep 2007 20:30:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cobol-eof-processing-and-the-start-command/m-p/4067650#M38432</guid>
      <dc:creator>Paul Raulerson</dc:creator>
      <dc:date>2007-09-09T20:30:55Z</dc:date>
    </item>
  </channel>
</rss>

