Page 1 of 1

VB file in Sort

PostPosted: Thu Apr 29, 2010 6:16 pm
by karthikchn
Hi,
Is it true that when I use a VB file in Sort, I have to add 4 bytes to the starting position in the fields= ?
I mean offset the position by 4 bytes?
Eg: if my field starts from position 1 in the actual file, i have to mention from comumn 5?

Thanks,
Karthikeyan.

Re: VB file in Sort

PostPosted: Thu Apr 29, 2010 7:17 pm
by William Thompson
Absolutly yes.

Re: VB file in Sort

PostPosted: Thu Apr 29, 2010 7:45 pm
by Robert Sample
Only if you want the sort to work correctly -- if you put position 1 for a variable blocked file, it'll sort by record length.

Re: VB file in Sort

PostPosted: Thu Apr 29, 2010 10:15 pm
by Frank Yaeger
Karthikeyan,

See the following for more information on this:

http://publibz.boulder.ibm.com/cgi-bin/ ... 0519162426

Re: VB file in Sort

PostPosted: Fri Apr 30, 2010 9:01 am
by karthikchn
Thanks for the replies.
But in Cobol we do not declare the first 4 bytes as some Record Descriptor. We start from column 1 only?
Can some one explain this?

Like this for other Record formats(VBA, V, etc..) what are the special points to be noted in sort, etc.

Karthikeyan.

Re: VB file in Sort

PostPosted: Fri Apr 30, 2010 9:48 am
by dick scherrer
Hello,

Simply said, you need to allow for the RDW (Record Descriptor Word) when specifying variable length data and using the sort.

You do not allow for the RDW in a cobol FD - it is handled by the system.

Re: VB file in Sort

PostPosted: Fri Apr 30, 2010 10:05 am
by William Thompson
But in Cobol we do not declare the first 4 bytes as some Record Descriptor.
Yes, and VSAM keys beginning in the first byte are defined as zero followed by length. Assembler too defines data at an address, the first byte is +0.

But Sort, like COBOL, deals with the first byte of data as position one, it just that sort allows a view or the length attributes of a variable length record, leaving it to you to account that extra four bytes.

V and VB are the same , LLBB (block length and two unused bytes) followed by llbb (record length and two unused bytes). Sort gives you the power to access the record length (also known as the RDW or Record Descripter Word).

COBOL protects you from that minor programming problem, as does browsing the file records under TSO.

As far as I know, the only difference between V and VB is that the LLBB for the V file is always the same as the llbb (pluse four bytes) . Be aware that in the case of a short last block on a VB file (only one record long) the LLBB will be the same as the llbb (pluse four bytes).

The A on VBA and FBA means that the first data byte is a printer cariage control character, as in 'skip to channal one' or 'double space'. Sort and COBOL both let you access this character.