When reading the doc, be careful about the term 'record'. For a physical 
device, 'record' means 'block' because the device has no notion of logical 
structure. As already pointed out, BSAM read returns an entire block (as in 
BLKSIZE) and leaves the task of segmenting into logical records entirely up to 
you. Some doc might use 'record' for what we understand as 'block'. 

By contrast, QSAM fetches a block (as necessary) and returns to your program 
one logical record at a time. The downside of QSAM is that your program enters 
an implicit WAIT on each read or write. Why a modern application would want to 
undertake the complexity of BSAM--unless required as discussed earlier--would 
be hard to argue. 

BTW as a nascent application programmer, I was advised to use GET LOCATE and 
PUT MOVE for simplest coding. 

.
.
J.O.Skip Robinson
Southern California Edison Company
Electric Dragon Team Paddler 
SHARE MVS Program Co-Manager
323-715-0595 Mobile
626-543-6132 Office ⇐=== NEW
robin...@sce.com


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Blaicher, Christopher Y.
Sent: Friday, February 03, 2017 11:50 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: (External):Re: BSAM vs QSAM

Careful on reusing that buffer before the ECB is posted in the write.  You 
could wind up overlaying what is in the middle of being written.  It is not 
safe to reuse the buffer before the ECB is posted.  You may get away with it 
most of the time, but if there is an error and the channel re-drives the I/O 
you may have laid new data in the buffer before the write is done.

Chris Blaicher
Technical Architect
Mainframe Development
Syncsort Incorporated
2 Blue Hill Plaza #1563, Pearl River, NY 10965

P: 201-930-8234  |  M: 512-627-3803
E: cblaic...@syncsort.com

www.syncsort.com

CONNECTING BIG IRON TO BIG DATA


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Farley, Peter x23353
Sent: Friday, February 3, 2017 2:42 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: BSAM vs QSAM

BSAM only gets you an entire block on a READ.  You have to extract each varying 
record from the block with your own code.

On a WRITE you have to give it an entire block, BDW + one or more RDW + record. 
 You have to construct the block yourself in your own code before you issue the 
WRITE.

OTOH you don't have to wait for completion of a READ or a WRITE.  You can issue 
a WRITE at the end of a processing loop and then go back to process the next 
record while the WRITE completes, and only CHECK the WRITE when you are ready 
to issue the next WRITE.

Similarly for READ's, issue another READ right after the start of processing 
for the prior record, then CHECK the second READ when you come back to the top 
of the processing loop.

Complicated, but it can provide improved (FSVO improved) elapsed time by 
overlapping processing with I/O rather than processing synchronously.

HTH

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Joseph Reichman
Sent: Friday, February 03, 2017 2:27 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: BSAM vs QSAM

I have huge VB files

Don't really understand what you mean by

Deblock after doing a READ then WAIT

Where an entire block is read subsequent READs Just point to the next record

> On Feb 3, 2017, at 2:22 PM, Blaicher, Christopher Y. <cblaic...@syncsort.com> 
> wrote:
>
> There can be if you code for just what you expect.
>
> QSAM does multi-buffer I/O for you, with BSAM you have to issue multiple 
> WRITE or REAAD commands and do a WAIT, not to mention having to block or 
> de-block the buffer, which can be a real pain for VBS files.
>
> It really depends on how much you are processing and how often you are doing 
> it to determine if the amount of time you are going to spend on developing it 
> makes it worth it.
>
> Using QSAM with GET LOCATE (as long as you aren't processing VBS files) and a 
> reasonable BUFNO of 10 or more is going to get you close to most BSAM 
> applications.  GET or PUT with the MOVE option is the easiest to code for.
>
> Chris Blaicher
> Technical Architect
> Mainframe Development
> Syncsort Incorporated
> 2 Blue Hill Plaza #1563, Pearl River, NY 10965
>
> P: 201-930-8234  |  M: 512-627-3803
> E: cblaic...@syncsort.com
>
> www.syncsort.com
>
> CONNECTING BIG IRON TO BIG DATA
>
>
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] 
> On Behalf Of Joseph Reichman
> Sent: Friday, February 3, 2017 1:51 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: BSAM vs QSAM
>
> Hi
>
> BSAM is a bit more complex than QSAM
>
> Is there any performance improvement
>
> Thanks


----------------------------------------------------------------------
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