<?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: Something strange happens when I am sequentially accessing records in indexed file. in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946528#M22385</link>
    <description>Oh... I forgot to throw in the 'free advice'.&lt;BR /&gt;This file probably needs tuning.&lt;BR /&gt;That bucket size of 3 is the minimum to hold the maximum record size: 1024&lt;BR /&gt;It is unlikely to be optimal&lt;BR /&gt;(check out: ANAL/RMS/FDL ... EDIT/FDL/NOINT... CONV/FDL/FAST/NOSORT/STAT )&lt;BR /&gt;&lt;BR /&gt;That 1024 MRS. That is an 'odd' number. Sounds like an application which tries to 'help' by adapting to what it thinks is a nice value to the system. Well, 1024 is not nice, or rather irrelevant for indexed files with variable length records (and compression).&lt;BR /&gt;(the 'not nice' part is that rms indexed file records are stored in buckets, where each bucket has 15 overhead bytes and each record 11 or 13 bytes overhead. So a two block 1024 byte bucket can hold at the most a 998 bytes... not that you would want just one record and no space for RRVs)&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,</description>
    <pubDate>Tue, 13 Dec 2005 13:36:00 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2005-12-13T13:36:00Z</dc:date>
    <item>
      <title>Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946524#M22381</link>
      <description>Hi guys,&lt;BR /&gt;I have several processes (executing the same image) that are putting and updating records in indexed variable length record file (mrs=1024 bytes).&lt;BR /&gt;File has only one index that is made from the first 14 bytes or the record:&lt;BR /&gt;ID (__int64);&lt;BR /&gt;recordno (int)&lt;BR /&gt;fieldno (short).&lt;BR /&gt;&lt;BR /&gt;Sometimes I need to copy some records from this file to another. I am sequentially accessing all records&lt;BR /&gt;in source file and put them to destination. Doing that I noticed some strange things with ordering in source file. &lt;BR /&gt;Here is record sequence that is good: &lt;BR /&gt;========================&lt;BR /&gt;ID      recordno fieldno&lt;BR /&gt;========================&lt;BR /&gt;74138282771   0  0&lt;BR /&gt;74138282771   1  1&lt;BR /&gt;74138282771   1  2&lt;BR /&gt;74138282771   1  3&lt;BR /&gt;74138282771   1  4&lt;BR /&gt;74138282771   1  5&lt;BR /&gt;74138282771   1  6&lt;BR /&gt;74138282771   1  7&lt;BR /&gt;74138282771   1  8&lt;BR /&gt;74138282771   1  9&lt;BR /&gt;74138282771   2  1&lt;BR /&gt;74138282771   2  2&lt;BR /&gt;74138282771   2  3&lt;BR /&gt;74138282771   2  4&lt;BR /&gt;74138282771   2  5&lt;BR /&gt;74138282771   2  6&lt;BR /&gt;74138282771   2  7&lt;BR /&gt;74138282771   2  8&lt;BR /&gt;74138282771   2  9&lt;BR /&gt;&lt;BR /&gt;and sometimes (for very long recordsets where recordno changes from 0 to 50000 or even more) I see something like that:&lt;BR /&gt;&lt;BR /&gt;4815790862337   0  0    &lt;BR /&gt;4815790862337   256  1    &lt;BR /&gt;4815790862337   256  2    &lt;BR /&gt;4815790862337   256  3    &lt;BR /&gt;4815790862337   256  4    &lt;BR /&gt;4815790862337   512  1    &lt;BR /&gt;4815790862337   512  2    &lt;BR /&gt;4815790862337   512  3    &lt;BR /&gt;4815790862337   512  4    &lt;BR /&gt;4815790862337   768  1    &lt;BR /&gt;4815790862337   768  2    &lt;BR /&gt;4815790862337   768  3    &lt;BR /&gt;4815790862337   768  4    &lt;BR /&gt;4815790862337   1024  1    &lt;BR /&gt;4815790862337   1024  2    &lt;BR /&gt;4815790862337   1024  3    &lt;BR /&gt;4815790862337   1024  4    &lt;BR /&gt;4815790862337   1280  1    &lt;BR /&gt;4815790862337   1280  2    &lt;BR /&gt;4815790862337   1280  3    &lt;BR /&gt;4815790862337   1280  4    &lt;BR /&gt;4815790862337   1536  1    &lt;BR /&gt;4815790862337   1536  2    &lt;BR /&gt;4815790862337   1536  3    &lt;BR /&gt;4815790862337   1536  4    &lt;BR /&gt;......&lt;BR /&gt;4815790862337   51200  1    &lt;BR /&gt;4815790862337   51200  2    &lt;BR /&gt;4815790862337   51200  3    &lt;BR /&gt;4815790862337   51200  4    &lt;BR /&gt;4815790862337   51968  1    &lt;BR /&gt;4815790862337   51968  2    &lt;BR /&gt;4815790862337   51968  3    &lt;BR /&gt;4815790862337   51968  4    &lt;BR /&gt;4815790862337   1  1    &lt;BR /&gt;4815790862337   1  2    &lt;BR /&gt;4815790862337   1  3    &lt;BR /&gt;4815790862337   1  4    &lt;BR /&gt;4815790862337   257  1    &lt;BR /&gt;4815790862337   257  2    &lt;BR /&gt;4815790862337   257  3    &lt;BR /&gt;4815790862337   257  4    &lt;BR /&gt;4815790862337   513  1    &lt;BR /&gt;4815790862337   513  2    &lt;BR /&gt;4815790862337   513  3    &lt;BR /&gt;4815790862337   513  4    &lt;BR /&gt;4815790862337   769  1    &lt;BR /&gt;4815790862337   769  2    &lt;BR /&gt;4815790862337   769  3    &lt;BR /&gt;4815790862337   769  4&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;To be clear, recordno is changing according this algorithm (Nmax - is max.number of records and&lt;BR /&gt;Nmax &amp;gt; 256).&lt;BR /&gt;&lt;BR /&gt;recordno = 0;&lt;BR /&gt;fieldno = 0;&lt;BR /&gt;&lt;BR /&gt;for(k = 0; k &amp;lt; 256; k++)&lt;BR /&gt;{&lt;BR /&gt;  for(j=1; k + 256*j &amp;lt;= Nmax; j++)&lt;BR /&gt;  {&lt;BR /&gt;    recordno = k + 256*j;&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I feel that if number of records for some ID is &amp;lt; 256 - recordset will be ordered correctly,&lt;BR /&gt;otherwise according algorithm given above.&lt;BR /&gt;Mayne somebody can explain this situation ....&lt;BR /&gt;&lt;BR /&gt;Sorry for the very long story.&lt;BR /&gt;Kind regards&lt;BR /&gt;Sergejus&lt;BR /&gt;&lt;BR /&gt;Here is some info on source file:&lt;BR /&gt;&lt;BR /&gt;OMNITE $ dir DML_SERVER.TBL_TASK/full&lt;BR /&gt;&lt;BR /&gt;Directory $1$DGA4342:[DMLTEST]&lt;BR /&gt;&lt;BR /&gt;DML_SERVER.TBL_TASK;1                     File ID:  (6317,66,0)&lt;BR /&gt;Size:       434340/434340     Owner:    [DMLTEST]&lt;BR /&gt;Created:    27-MAY-2005 16:00:42.63&lt;BR /&gt;Revised:     6-SEP-2005 14:46:58.13 (273)&lt;BR /&gt;Expires:    &lt;NONE specified=""&gt;&lt;BR /&gt;Backup:     &lt;NO backup="" recorded=""&gt;&lt;BR /&gt;Effective:  &lt;NONE specified=""&gt;&lt;BR /&gt;Recording:  &lt;NONE specified=""&gt;&lt;BR /&gt;Accessed:   &lt;NONE specified=""&gt;&lt;BR /&gt;Attributes: &lt;NONE specified=""&gt;&lt;BR /&gt;Modified:   &lt;NONE specified=""&gt;&lt;BR /&gt;Linkcount:  1&lt;BR /&gt;File organization:  Indexed, Prolog: 3, Using 1 key&lt;BR /&gt;Shelved state:      Online&lt;BR /&gt;Caching attribute:  Writethrough&lt;BR /&gt;File attributes:    Allocation: 434340, Extend: 0, Maximum bucket size: 3, Global buffer count: 40, No version limit&lt;BR /&gt;Record format:      Variable length, maximum 1024 bytes, longest 0 bytes&lt;BR /&gt;Record attributes:  None&lt;BR /&gt;RMS attributes:     None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection:    System:RWED, Owner:RWE, Group:, World:&lt;BR /&gt;Access Cntrl List:  (IDENTIFIER=JUP_TEST1,ACCESS=READ+WRITE+DELETE+CONTROL)&lt;BR /&gt;                    (IDENTIFIER=JUP_TRAINING,ACCESS=READ+WRITE+DELETE+CONTROL)&lt;BR /&gt;Client attributes:  None&lt;BR /&gt;&lt;BR /&gt;Total of 1 file, 434340/434340 blocks.&lt;BR /&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NO&gt;&lt;/NONE&gt;</description>
      <pubDate>Tue, 13 Dec 2005 10:33:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946524#M22381</guid>
      <dc:creator>Sergejus Zabinskis</dc:creator>
      <dc:date>2005-12-13T10:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946525#M22382</link>
      <description>Sergejus,&lt;BR /&gt;&lt;BR /&gt;The key is probably of string type. Bytes are sorted as signed bytes. In the sequence (I ommit the ID part):&lt;BR /&gt;&lt;BR /&gt;xxxx 0 0&lt;BR /&gt;xxxx 256 1&lt;BR /&gt;xxxx 512 1&lt;BR /&gt;xxxx 1 1&lt;BR /&gt;&lt;BR /&gt;you have realy this sequence (because of little endians):&lt;BR /&gt;&lt;BR /&gt;ID   recordno fieldno&lt;BR /&gt;xxxx 0 0 0 0  0 0&lt;BR /&gt;xxxx 0 1 0 0  1 0&lt;BR /&gt;xxxx 0 2 0 0  1 0&lt;BR /&gt;xxxx 1 0 0 0  1 0&lt;BR /&gt;&lt;BR /&gt;and if you look so the sequence is in right order. (The same thing is with the id).&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Tue, 13 Dec 2005 11:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946525#M22382</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2005-12-13T11:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946526#M22383</link>
      <description>Sorry,&lt;BR /&gt;&lt;BR /&gt;A typo in previous post:&lt;BR /&gt;&lt;BR /&gt;Bytes are sorted as unsigned bytes.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Tue, 13 Dec 2005 11:52:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946526#M22383</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2005-12-13T11:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946527#M22384</link>
      <description>Sergejus,&lt;BR /&gt;&lt;BR /&gt;Carefully read Bojan's reply. &lt;BR /&gt;I'm pretty sure he nailed the problem.&lt;BR /&gt;To verify this you need to look at the key definition. (and perhaps shared the with us)&lt;BR /&gt;You do this using ANAL/RMS/FDL&lt;BR /&gt;Bojan (and me) suspect to see a single unsegmented key something like:&lt;BR /&gt;  SEG0_LENGTH             14&lt;BR /&gt;  SEG0_POSITION           0&lt;BR /&gt;That will NOT do what you want.&lt;BR /&gt;&lt;BR /&gt;You can not get what you want from RMS, but you can get close, by defining the key as SEGMENTED. Unfortunately RMS only allows TEXT attributes for segmented keys, So you are stuck with each segment being a single byte drilling down from most significant down to least. You'll need to drop some bytes from the sub-fields to get there. (if you can get there).&lt;BR /&gt;&lt;BR /&gt;The easier/better solution is to change the application to use a real text key, a hex key, or a BCD key to get proper sorting in a single segment&lt;BR /&gt;&lt;BR /&gt;Good luck,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Dec 2005 13:26:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946527#M22384</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-12-13T13:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946528#M22385</link>
      <description>Oh... I forgot to throw in the 'free advice'.&lt;BR /&gt;This file probably needs tuning.&lt;BR /&gt;That bucket size of 3 is the minimum to hold the maximum record size: 1024&lt;BR /&gt;It is unlikely to be optimal&lt;BR /&gt;(check out: ANAL/RMS/FDL ... EDIT/FDL/NOINT... CONV/FDL/FAST/NOSORT/STAT )&lt;BR /&gt;&lt;BR /&gt;That 1024 MRS. That is an 'odd' number. Sounds like an application which tries to 'help' by adapting to what it thinks is a nice value to the system. Well, 1024 is not nice, or rather irrelevant for indexed files with variable length records (and compression).&lt;BR /&gt;(the 'not nice' part is that rms indexed file records are stored in buckets, where each bucket has 15 overhead bytes and each record 11 or 13 bytes overhead. So a two block 1024 byte bucket can hold at the most a 998 bytes... not that you would want just one record and no space for RRVs)&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,</description>
      <pubDate>Tue, 13 Dec 2005 13:36:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946528#M22385</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-12-13T13:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946529#M22386</link>
      <description>Thanks Bojan and Hein.&lt;BR /&gt;Of course you are right.&lt;BR /&gt;&lt;BR /&gt;Kind regards&lt;BR /&gt;Sergejus</description>
      <pubDate>Wed, 14 Dec 2005 02:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946529#M22386</guid>
      <dc:creator>Sergejus Zabinskis</dc:creator>
      <dc:date>2005-12-14T02:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Something strange happens when I am sequentially accessing records in indexed file.</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946530#M22387</link>
      <description>I received right solution of my situation.</description>
      <pubDate>Wed, 14 Dec 2005 02:52:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/something-strange-happens-when-i-am-sequentially-accessing/m-p/4946530#M22387</guid>
      <dc:creator>Sergejus Zabinskis</dc:creator>
      <dc:date>2005-12-14T02:52:06Z</dc:date>
    </item>
  </channel>
</rss>

