On Tue, Jul 19, 2016 at 9:02 AM, Reichman Joseph <[email protected]> wrote:
> Hi, > > Would anyone know the plus and or minus for using BSAM as opposed to QSAM > for VB records. It seems with BSAM there is more control e.g. specifying > the BDW as well as the RDW. Wondering about performance. > > I am guessing if you know what you are doing BSAM would be faster. If > anyone could point me to examples using BSAM would appreciated. As I have > mainly used QSAM specifying the RDW > > Thanks > > Joe Reichman > βIn general (VB or FB), QSAM is much easier to program. The access method just hands you individual records. But you pay for this in that you cannot do I/O overlap yourself. With BSAM, you do a READ. But the _block_ is not available to you (for certain sure) until you do a CHECK. But this allows you to test the I/O ECB and "do something else" if it has not been POST'd yet. A type of "useful polling" loop. Also, if you are reading multiple files, you can do a ECBLIST and wait for any one of the I/Os to complete instead of doing the I/O serially. Again performance. The problem is that _your code_ must de-block the β individual records. For VB, you should probably determine the number of byte read in the block (they aren't necessarily all the same size, you know) and check that the value in the BDW agrees with this number. And the code to do this is non-obvious because what you end up doing is knowing how many bytes you asked for and the I/O control block tells you the residual byte count - not the byte read but more like "you asked to read some bytes and there were β were not enough in the block - the block was short by ? bytes). So the number of bytes read is the number of bytes you requested in the READ (not given back to you - you must remember) minus the "residual byte" count which is returned. IOW - unless you are very clever and you have a real need for I/O overlap performance, and you don't mind the maintenance programmer cussing you out, then I'd just go with QSAM. -- "Worry was nothing more than paying interest on a loan that a man may never borrow" From: "Quest for the White Wind" by Alan Black Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
