|
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 compareall
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 oftwo
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 ais
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
twoa file in QSYS2 or a field in INFDS that can tell me if io buffer of
Well, Idifferent files are the same. I guess there is no such thing.
attributes.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
If those attributes are sufficient to determine "identical" foryour
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"allocated
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
length" of a VARCHAR.
Regards, Chuck
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.