Page 1 of 1

VBS and VB for SORT JCL.

Posted: Tue Jan 09, 2018 3:31 pm
by Ashish Mathew
Hi,

I need to work with a file which is VBS, does VBS file treated same as VB file by SORT? Please let me know.

Re: VBS and VB for SORT JCL.

Posted: Tue Jan 09, 2018 6:19 pm
by Robert Sample
SORT should treat the VBS data set the same as a VB data set. The difference between VBS and VB is that the shortest block in a VBS will be no less than 4 bytes smaller than the block size, while a VB may have a block that is just under the LRECL shorter than the block size. For a data set defined with 10000 LRECL and 27998 BLKSIZE, the difference could be significant -- a block could be less than 18000 bytes with VB but no less than 27995 with VBS.

Re: VBS and VB for SORT JCL.

Posted: Thu Feb 15, 2018 2:03 pm
by Ashish Mathew
Robert Sample wrote: Tue Jan 09, 2018 6:19 pmSORT should treat the VBS data set the same as a VB data set. The difference between VBS and VB is that the shortest block in a VBS will be no less than 4 bytes smaller than the block size, while a VB may have a block that is just under the LRECL shorter than the block size. For a data set defined with 10000 LRECL and 27998 BLKSIZE, the difference could be significant -- a block could be less than 18000 bytes with VB but no less than 27995 with VBS.
Hi Thanks Robert,

how did you get those numbers, what is the calculation?

Re: VBS and VB for SORT JCL.

Posted: Thu Feb 15, 2018 4:21 pm
by nicc
What have you searched for that you did not find the answer yourself? Robert is always explaining space/blksize/lrecl calculations.

Re: VBS and VB for SORT JCL.

Posted: Thu Feb 15, 2018 6:12 pm
by Robert Sample
When the system is filling a block before writing it out, for VBS the system will use the space as long as there are 5 bytes available in the block (4 for the segment descriptor word and 1 for data); for VB if the new record would cause the block to overflow then the write occurs and the new record starts a new block. So for a 10000-byte record, which needs 10004 bytes, a block with 17995 bytes in it would force the write and starting a new block. So no more than 4 bytes per block will be unused in a VBS data set while a VB data set block length depends upon the record lengths.

Re: VBS and VB for SORT JCL.

Posted: Tue Feb 20, 2018 6:46 pm
by Ashish Mathew
Thanks Robert. This is a great explanation, I had to re-read it multiple time to understand this. :)