I'm having a heck of a time reading multiple members
from the same BPAM DCB... but not sequentially, trying
to "skip around" in the members (for example, read one block of 
MEM1, one block of MEM2, back to MEM1 to read the next block, 
back to MEM2 to read the next block, etc...)

This is input only.

I'm using NOTE + FIND&POINT to switch between members.

That is, when I need to switch to a different member, I remember
the current TTR with a NOTE, then a I do a FIND for the other member
and POINT to  it's remembered TTR.

As it happens, MEM1 only has one block, while MEM2 has many...

Now - for my questions...

This is the behavior I'm seeing with my operations (results in the comments):

  FIND MEM1
  NOTE    - returns TTR X'11B00'
  READ        reads a short first block
  CHECK
*     <process block>
  NOTE    - returns TTR X'11C00', remembers as the current TTR for MEM1
  FIND MEM2
  NOTE    - returns TTR X'11000'
  READ         correctly reads first block of MEM2
  CHECK
*     <process block>
  NOTE   - returns TTR X'11100'
*
* Return back to processing MEM1
*
  FIND MEM1
  POINT X'11C00'   Point back to remembered TTR for MEM1
  NOTE   <*** RETURNs X'11B00' - not the block I just POINTed to
  READ
  CHECK
*  Check drives my EOD exit, so END-OF-DATA is noted for MEM1
*
* Return back to processing MEM2
*
   FIND MEM2
   POINT X'11100'  Point back to remembered TTR for MEM2
   NOTE   <*** RETURNSs X'11000' - not the block I just POINTed to
   READ
   CHECK  <*** Drives EOD exit
* END-OF-DATA noted for MEM2


So - my questions (that I hope someone can illuminate) are:

  1) Why does the NOTE following a successful POINT indicate a 
     different TTR (it seems to indicate the preceeding TTR.)

  2) MEM2 has many more blocks in it, but my EOD exit is driven
      when attempting to read the 2nd block, even though I did a FIND
      and POINT to reposition.  It seems once the EOD of a member
      is found, others suffer the same fate?

I've gone through my code to look for errors (such as passing the wrong
value to POINT, etc...)  but nothing "obvious" appears wrong.   And,
I've verified that the EODAD is being driven on the subsequent read
of MEM2.

What I'm trying to do is keep the same DCB and process multiple
members, "bouncing" between them; without suffering a new OPEN
for each.

I did some googling to see if I could find some sample code for
this; but I've been unsuccessful.

The IBM documentation seems to indicate this it the proper approach;
but it's only mentioned under PDSEs... is it not valid for PDSs?

I have code that can keep the same DCB open for reading more than
one member of a PDS; but it reads the entire member before moving
to the next.. and in this new situation I only want to read part
of a member, and then return to it after reading part of a different
member...

Any pointers would be appreciated...

   - Many thanks! -
        - Dave Rivers -

-- 
[email protected]                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

Reply via email to