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



Hello,

On Wed, 26 Dec 2001, Rajiniganth Manickannan wrote:
>
> Hi ,
>   I require to dynamically get the database file field names and then
> compare its value with a pre-defined value.
>
>   It requires loading an array with all the file field names and the
> positions, using DSPOBJD command output.
>
>   Whenever I read a file, i should get the values based on the file
> field positions (obtained from the DSPOBJD command output) and then
> compare it. How can i do this?

DSPOBJD won't give you the field names or positions.  If you want to
use the CL command/outfile method, try the DSPFFD command.

(DSPOBJD might come in handy for finding the files to begin with,
however.)

> Is there a way to get the file field value based on the buffer
> positions? Is there an API for achieving that? Thanks in advance..

This part of it is, unfortunately, not that simple.  If possible, I'd do
something like this:

    1)  Create your program to have a program described file with a 32k
          record size.  Make the file USROPN.
    2)  In your I-specs, create a single field, 32k in size.
    3)  In your C specs, do an OVRDBF to get the file that you want, and
          then open the file.
    4)  Call DSPFFD or QUSLFLD (or similar) to get the field positions.
    5)  Use the %subst BIF to extract the data type from the appropriate
           positions of the 32k input field.
    6)  If the data is supposed to be numeric, or a date, etc, you'll
           need to write routines to interpret that data.  It really
           depends on what you intend to do with the data.

So... that method will work, as long as your file does not require reading
or positioning by key.

If you do require keyed access, you'll have to look at using the _Ropen,
and related functions from the ILE C runtime library.   In that case, you
would replace items 1 & 2 above with calls to the ILE C runtime library.

This could turn into some fairly heavy programming -- depending of course
on exactly what you need to do with the data.  If you tell us what you
need to do with this data, there's a good chance that we could give you
a simpler alternative.

>
> Thanks + Regards,
> Rajiniganth M

Good luck!




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.