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



Lim Hock-Chai wrote:
Is File Record Format Level ID the only way to determine if
format of two files are identical? If so, can someone point
me to a api that I can use to retrieve the
Record Format Level ID of a file?


The only valid comparison for "identical" is to either confirm that the format is shared by the other file, or to extract & then compare all of the specific format & field attributes for which "identical" can be inferred. There is an API to list record formats [and sharers] for a file, plus the DSPDBR command.

The Record Format Level Identifier is merely a hash, which can conveniently be used to _infer_ that the attributes of a given format does *not* match a prior extracted LvlId from the [functionally] same file. The opposite can not be inferred, so each attribute of interest must be verified, for a matching hash. As a hash, it is impossible to infer definitively that two identical hash values are indicative of two identical formats. It is possible that several distinct formats [across the hashed attributes] will generate the same hash value; and in fact, the change of a field data type between Alpha and Zoned, without a change in its length, is likely to generate the same FmtLvlId. It is the responsibility of the developer to ensure the changed format has also generated a new [hash] level.

Yes, IO buffer comparison is all I needed. I was hopping that there is
a file in QSYS2 or a field in INFDS that can tell me if io buffer of two
different files are the same. I guess there is no such thing. Well, I
have no choice but go for the api.

The system database cross-reference file QADBIFLD in QSYS [and its logicals, e.g. SYSCOLUMNS in QSYS2] have a variety of field attributes. If those attributes are sufficient to determine "identical" for your purposes, then any exception to the join [or ordered line comparison] of the field attributes of two files can verify the format of each file does not match the other. One specific attribute that I know is not available [but should not be relevant for I/O buffer] is the "allocated length" of a VARCHAR.

Regards, Chuck

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.