On 4/2/2011 5:14 AM, Monika Amiss wrote:
I'm wondering if there is a way to get the size of a temporary QSAM-Dataset 
programmatically
without opening and seeking to the end of the file. The program, which needs 
the size information
is written in C (and so can call Assembler) and runs in z/OS-Batch. I played 
around with fstat()
but did not get my results. The best approach until now seem to me to use CALL 
ISPLINK and
get via LMDLIST the ZDLSIZE (used Tracks of the Dataset). But perhaps somebody 
has a better idea,
perhaps I can use RDJFCB or BPXWDYN to get to my values.

If the data set is not on DASD, the answer is no. For DASD, you can get an approximate size via used tracks. If you know the average block size, you may refine it a bit.

To get the information, I would use:

Get TIOT entry (scan for DD name; start with PSATOLD->TCBTIO); this gives you pointers to the JFCB (resolve via SWAREQ) and the UCB (for volume serial).

Issue an OBTAIN SEARCH for the data set name and volume serial to get the DSCB1, which contains DCB information, used tracks (1 + DS1LSTAR first two bytes), extent and other information. If the data set has not been opened, the DCB and LSTAR fields may be zero.

You'll need mapping macros CVT, IKJTCB, IHAPSA, IEFUCBOB, IEFTIOT1, and IECSDSL1 1, found in SYS1.MACLIB and SYS1.MODGEN.

If you have more than one DASD type, you may want to look at IECZDTAB (pointer in CVT, using UCBTBYT4 as index) to get characteristics (or use OBTAIN SEARCH for 44X'04' to get DSCB4).


Gerhard Postpischil
Bradford, VT

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