× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have been updating some old programs that called this API allocating 32767 for the receiver variable. I am now calling QDBRTVFD twice. First call allocates 8 to the receiver variable in order to get the size of the available data. I then allocate the size returned in the 1st call to the receiver variable for the 2nd call to QDBRTVFD. The second call to QDBRTVFD is not retrieving all the data and the size returned is not the same as the size returned on the first call to QDBRTVFD.

I am using the second field in the File Definition header (Number of bytes provided for the file definition data) to determine the size required. While the definition of this field does not say "number of bytes available", I have been assuming this is what it is providing (like some of the other APIs).

While QDBRTVFD seems to return the correct values on the first call when getting the description for a DDS created physical or logical files, it is not returning what I would expect for SQL created tables and in fact does not return all the basic information.

Example:

Qualified file name ASDISP ASSETS
Keyed SQL Table file with primary key constraints and referential constraints


File definition header after first call to QDBRTVFD ( I have renamed the IBM QSYSINC fields to be more readable in my programs)


> EVAL dbffhdr
DBFBYTRET OF DBFFHDR = 000000008.
DBFBYTPRO OF DBFFHDR = 000001218 <=== Number of bytes provided.
DBFATRBYTS OF DBFFHDR = '­Ø'
DBFDTAMBRS OF DBFFHDR = 0001.
DBFNBRKEYS OF DBFFHDR = 0000.
DBFMAXKLEN OF DBFFHDR = 0000.
DBFPTHATR OF DBFFHDR = ' '
DBFPATHM OF DBFFHDR = ' '
DBFNBRMBR OF DBFFHDR = 0000.
DBFNBRFMTS OF DBFFHDR = 0000.
DBFATRBYT2 OF DBFFHDR = ' '
DBFFILLVL OF DBFFHDR = ' '
DBFFILTXT OF DBFFHDR = '


Allocate 1218 to receiver variable and pass length of receiver variable as 1218

Call QDBRTVFD a second time with new receiver variable parameter values

File definition header after second call to QDBRTVFD

> EVAL dbffhdr
DBFBYTRET OF DBFFHDR = 000001125 <=== Bytes returned is less than the 1218 allocated.
DBFBYTPRO OF DBFFHDR = 000001413 <=== Now it returns a different value for bytes provided!
DBFATRBYTS OF DBFFHDR = '­Ø'
DBFDTAMBRS OF DBFFHDR = 0001.
DBFNBRKEYS OF DBFFHDR = 0002.
DBFMAXKLEN OF DBFFHDR = 0008.
DBFPTHATR OF DBFFHDR = ' '
DBFPATHM OF DBFFHDR = 'I'
DBFNBRMBR OF DBFFHDR = 0001.
DBFNBRFMTS OF DBFFHDR = 0001.
DBFATRBYT2 OF DBFFHDR = ' '
DBFFILLVL OF DBFFHDR = '1030202173959'
DBFFILTXT OF DBFFHDR = 'Asset Dispositions
DBFSRCFNAM OF DBFFHDR = 'DRMESQL '
DBFSRCMNAM OF DBFFHDR = 'ASSETMGMT '
DBFSRCLNAM OF DBFFHDR = 'DRMESRC '
DBFSCOPOFF OF DBFFHDR = 000000000. <=== missing offset to scope data
DBFACOLOFF OF DBFFHDR = 000000000.
DBFPTHTYP OF DBFFHDR = 'KU'
DBFFILVER OF DBFFHDR = 'V5R2M0'
DBFPFOFF OF DBFFHDR = 000000400.
DBFLFOFF OF DBFFHDR = 000000000.



I am on V5R3 Cum 4272

Am I missing something or is this in fact a bug in the API that needs to be reported?

If this is a bug, it is the second API bug I have found for the same type of problem (bytes available returned value is not correct). I hope this is not a trend. In the mean time, my work around is to keep calling the QDBRTVFD API until the bytes provided equals the bytes returned (testing shows this to be 3 calls to QDBRTVFD to get the expected results instead of the desired 2 calls).

Thanks for the help.


Dave Murvin DRM Enterprises, Inc.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.