Thanks Don and all for the suggestions. This is for a BSAM library routine, and I don't control the DD allocation. I want to get the TTR of the first block so that if the user does a "note" before doing one READ or WRITE, that I have the beginning position.
I understand how to proceed for READ - I can do a RDJFCB to see that it is for a PDS member and then open with BPAM (instead of BSAM) and do a BLDL/FIND to get the TTR and position to the member. Getting the TTR of the first block just after opening for WRITE is not so clear. If I open with BPAM, will it be in the DCBERELA field? I could try that to see. Thanks, Kirk Wolf Dovetailed Technologies http://dovetail.com On Mon, Jun 28, 2010 at 5:06 AM, Don Higgins <[email protected]> wrote: > Kirk > > I would normally use BPAM and BLDL to see if first member is there. But if > you want starting TTR of first member and don't know if it exists or what > the member name is, there is always the option to read the PDS directory > sequentially using BSAM with 256 byte record length and scan the directory > blocks just like BLDL svc does to find entry with lowest TTR if any. There > are old examples of this kind of code in the SHARE SPLA files including > some of mine. I once wrote a PDS scan utility to generate a formatted > dump of sorts of a PDS load module. Of course such code is not very > portable and is not recommended. For example, if there is no first > member, the starting TTR depends on the size of the directory and the > physical track size. I'd rather let the OS figure that out in SVC code. > > Don Higgins > [email protected] >
