If the question is whether there is direct z/OS support for this for FB
PS datasets, the answer is probably no, although if you get down to
assembler coding, there are ways to get close.
It looks like you could potentially design and implement an I/O
interface routine (in assembler) using BSAM access macros and POINT for
positioning to a block by calculating what block and record within a
block to start processing. Under the covers this is similar to what
VSAM does -- determine starting block and logically skip over unwanted
records in the first block . Since the smallest physical read is for a
block, you obviously can't avoid the overhead of a physical read of
unwanted records in the first and last needed blocks on
skip-sequential. With VSAM, if you allow too much buffer space, you can
even waste resources reading unneeded blocks beyond the last block
needed if only a few records are read at each read point.
Of course the nasty part is, I believe, all higher-level programming
languages are going to want to access the dataset using QSAM access for
buffered I/O, and POINT is not supported for QSAM access. A solution
likely requires Assembler code. A BSAM READ only reads a single block;
so by default there is no buffered read-ahead for following blocks and
no overlap between processing and disk block reads, and at best you only
get one block per disk revolution. If you want decent performance
reading multiple sequential blocks in a single disk rotation and
overlapping processing & I/O, I'm pretty sure you have to do your own
buffer management and queue up multiple read requests to initiate
reading blocks before they are needed, and only check for I/O completion
on a block when the block is needed. I think if multiple BSAM READs are
issued for sequential blocks in the same dataset, and their channel
programs are waiting in the queue for the channel, that zOS may chain
the channel programs of queued requests for the same dataset together so
that multiple blocks can be read in one disk revolution. If that's not
the case with BSAM access, and if each skip-sequential read sequence
will require multiple blocks, then getting down to the level of building
channel programs may be required for efficiency, and an efficient
solution becomes an order of magnitude more difficult.
So the longer answer is that it can be done, but unless you can find
assembler-level code that already provides this capability, this looks
like a lot of work just to avoid looking at a VSAM solution. Perhaps
someone has already written code to do this type of access efficiently
for FB PS datasets (check the CBT utilities?).
I would think whatever process generates a FB PS dataset could almost as
easily generate an ESDS dataset. Or perhaps an ESDS copy of the dataset
could be made.
This all presumes the FB PS dataset is created in such a way that the
only potentially-short block is the last. The mention of UNIX files is
an interesting thought, but I have no idea how clever that support may
be on doing buffered reads of subsequent blocks to maximize I/O
performance. ESDS skip-sequential should by default pre-read following
blocks based on number of buffers specified, which you can control.in
the JCL
JC Ewing
On 11/11/23 07:59, David S. wrote:
To help resolve a question posted to a LinkedIn group I manage:
www.linkedin.com/feed/update/urn:li:groupPost:910927-7128598004344786944
... I'd like to find out if there's any way to achieve *true*
Skip-Sequential processing with a Fixed Block Sequential File with a fairly
short record length (i.e. DCB=(DSORG=PS,RECFM=FB,LRECL=80)?
For example: Begin sequential processing at record number 100, *without*
having to read the first 99 records.
Note: We already know certain VSAM formats can do this, but the file in
question is a DSORG=PS *Sequential* file, *not* VSAM. This is a rock-solid
requirement and cannot be changed. We also already know how certain
utilities such as SORT and REXX can *mimic* skip-sequential functionality
by *discarding* unwanted records until the specified record number is
reached. This is a likewise rock-solid requirement. Sequential processing
*must* begin at specified starting point and there can be *no* reading of
any records prior to that point.
My gut feeling is it *cannot* be done - at least not with RECFM=FB. It
*might* be possible with RECFM=F, but efficiency would then be so
compromised it would probably outweigh any advantage from *true*
skip-sequential processing.
--
Joel C. Ewing
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN