×
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'm trying to retrieve the description of a file and am having issues.
I was already using the API QUSLFLD, in which the File Header data
structure has a record text field. This value is ending up blank for
both a physical file w/o the TEXT value set on the record and for a PF
w/a TEXT value set. All the other values in this data structure load as
expected.
I tried my hand at using the QDBRTVFD API after looking at some examples
from Bob Cozzi and Leif Guldbrand, however my resulting data structure
is completely empty, and the error data structure lists bytes available
but not provided - so I don't think there's an error in the API. The
API returns the File/Library in the Return File field so it's finding
the file.
I also tried to see if any C Functions were available to give me
information about a file, but after a quick look through the ILE C/C++
manual I didn't find anything.
My guess is that I'm not doing something right with the QDBRTVFD API, so
if anyone can chime in, I'd appreciate it.
Here's my QDBRTVFD code. Note, gFileDesc is 50a and gFormattedFile is
20a where the 1st 10 char is the filename and the last 10 is the
library.
P getFileDesc B
D PI
DmyFileInfo DS Qualified Inz
D bytes_returned 10i 0
D bytes_avail 10i 0
** Need to use %BITAND() to test the fileAttr subfield
D fileAttr 2a
D reserved1 4a
D dataMbrs 5i 0
D keySeqAttr LikeDS(Qdb_Qdbfkdat_t)
D pubAuth 10a
D prefStorageUnit...
D 3u 0
D maxMbrs 5i 0
D waitFile 5i 0
D FRCWRITE 5i 0
D curMbrCount 5i 0
D accPathPageSize...
D 5i 0
D reserved2 7a
D waitRCD 5i 0
D qaaf 1a
D rcdFmtCount 5i 0
D qdbfhfl2 2a
D OSVRM 5i 0
D qaaf2 2a
D fileCRTDate 13a
D fileText 52a
D reserved3 2a Overlay(fileText)
D textDesc 50a Overlay(fileText:*NEXT)
// Used as a template for the keySeqAttr subfield
D Qdb_Qdbfkdat_t DS Qualified Based(NULL)
D Qdbfknum 5I 0
D Qdbfkmxl 5I 0
D Qdbfkflg 1A
D Qdbfkfdm 1A
D reserved 8A
// Local Variables
D rtnFileName S 20a
// Prototype for the Retrieve File Description API
D QDBRTVFD PR ExtPgm( 'QDBRTVFD' )
D szRtnBufrer 32765a Options( *VarSize )
D nBuffLen 10i 0 Const
D rtnFileName 20a
D szAPIFmt 8a Const
D szQualFile 20a Const
D szRcdFmt 10a Const
D bOverride 1a Const
D szRmtLocSys 10a Const
D szIntFileType 10a Const
D api_error LikeDS( APIErrorDS )
D Options( *VarSize )
Kurt Anderson
Application Developer
Highsmith
W5527 State Road 106, P.O. Box 800
Fort Atkinson, WI 53538-0800
TEL (920) 563-9571 FAX (920) 563-7395
EMAIL kjanderson@xxxxxxxxxxxxx
As an Amazon Associate we earn from qualifying purchases.
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.