On Thu, 2 Aug 2012 17:00:02 -0400, Thomas David Rivers <riv...@dignus.com> 
wrote:

>I'm having some issues with using the OS Simulation
>macros NOTE and POINT under VM/CMS.
>
>I've been scouring documentation to try and
>discover just what the CMS differences are...
>
>But, at the moment, I'm trying to simply do
>a BSAM OPEN (for READ)...
>
>Then, a NOTE to record the starting TTR of the
>file...
>
>Then - reading the file to the end (with regular
>BSAM READ+CHECK)
>
>Then, a POINT to return to the beginning of the file,
>using the TTR retrieved from just after the OPEN
>(with +1 added because the NOTE occurs after OPEN
>but before any READ.)
>
>Then - try and READ the blocks again...
>
>What I'm seeing is that the NOTE returns something
>that "looks like" a TTR.  Then, the READs+CHECKs
>occur that read the file.
>
>The POINT supposedly returns us to the begining,
>but the next READ gets EOD.
>
>Clearly - the POINT hasn't worked.
>
>And, as you might expect - this approach works just
>great on z/OS.
>
>Does anyone know of any vagaries with the OS simulation
>of NOTE/POINT?
>
>I did see that you can't code TYPE=REL (or TYPE=anything
>for that matter.)  But, I don't really care what the block
>address is... just that it is the valid block address for the
>beginning of the file.
>
>Thanks for any pointers!

First pointer:  We welcome your CMS questions over on IBMVM!  ;-)

Sorry I haven't been watching IBM-MAIN as closely as I should, but the "TTR" 
isn't.  It's the CMS file system record number of the record that was just read 
(shifted left 8 bits) i.e. rrrrrr00.  At OPEN, no records have been read, so 
the record number is zero.  You NOTEd the zero value and added 1.   Then you 
POINTed to 0x000001, but that low-order byte isn't used, so you are effectively 
pointing to record zero.    When a zero is passed to the lower-level CMS 
filesystem interfaces (FSREAD/FSWRITE), it means "read or write next record". 

To increment the record number by one, add 256 to the "TTR".  To explicitly 
position to record 1,  POINT to "TTR" 0x00000100

Alan Altmark
IBM 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to