> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Thomas David Rivers
> Sent: Monday, April 24, 2006 1:41 PM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Reading Variable record with bad BDW/RDW?
> 
> 
> I've got a question for the group-at-large, which I hope
> will be obvious to someone deeply in-the-know.
> 
> I've got a program that opens a VB PDS 
> (RECFM=VB,BLKSIZE=2550,LRECL=255).
> 
> But - note that I said it opens the PDS, not a member of the 
> PDS.  That
> open succeeds, and presumably, the program will merrily try to
> read the PDS directory as Format-V records.
> 
> So - the first read succeeds, and it gets these bytes back for
> the first 6:
> 
>       000EFFFF  FFFF
>         | BDW  | | RDW ....
> 
> The BDW indicates a block-len of 14, but the 'reserved' bytes 
> are not 00.
> The RDW then indicates a record length of 65535 - which is 
> preposterous
> given that the BDW said the entire block-len was only 14.
> 
> And - of course, trying to read 65531 bytes for the remaining record
> doesn't work, because they aren't there.  The 14 isn't there either.
> 
> OK - admittedly - walking thru the directory entries and trying
> to interpret that as VB isn't the best thing in the world... but,
> what's a program "to do" with what the user types.
> 
> Should it look at the lrecl/blksize in the DCB and decide that
> this doesn't make sense?  What if it did make sense - then what?
> 
> Or - is there a way to know this is a bunch of bytes from a
> PDS directory... and this READ doesn't make sense?
> 
>       - Many thanks! -
>       - Dave Rivers -

The directory of a PDS is not VB. It is
RECFM=F,LRECL=256,BLKSIZE=256,KEYLEN=8. You can ignore the key, if you
want. You must read all 256 bytes and "deblock" the "logical records"
yourself. They are not compatable with RECFM=VB, but they are "close".
"Close" only counts in horse shoes and nuclear weapons.

I have code, which I got from somewhere, that I can share. I also sure
that there is some available on http://cbttape.org somewhere, but I
don't know where.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its
content is protected by law.  If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited. 
 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to