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



On 20-Feb-2015 16:09 -0600, Vinay Gavankar wrote:
On Fri, Feb 20, 2015 at 4:42 PM, CRPence wrote:
On 20-Feb-2015 14:09 -0600, Vinay Gavankar wrote:

Is there a way in CL to compare 2 physical file members and get
a Same/Not same kind of answer?

Somewhat depends on the definition of /same/ and what is
available to effect the comparisons [mostly for anything other
than the SQL] might depend on the definition of the file and\or
amount of data. Does /same/ mean merely the same set, the
identical physical rows sequentially, or even the identical
physical rows by RRN?


The number of records expected is less than 1,000 and "same" means
identical physical rows sequentially (since not expecting any deleted
records, this would be same as by RRN in this case).


The cmp utility in QSHell may suffice, but the definition of the files might matter. No example of the definitions for the files was offered, just the number of rows, so I guess just test the following QSH invocation [altering names as appropriate]; surely moot with such a small number of rows, but /size/ requires knowing both a number or records *and* the length of each record. The -s switch enables a /silent/ compare and the exit-code answers identical vs different vs failure of the request.

qsh cmd('cmp -s /qsys.lib/mylib.lib/file1.file/thembr.mbr
/qsys.lib/mylib.lib/file2.file/thembr.mbr')

Because the SQL is best suited for set-data, accounting for the physical sequence is not ideal. For an SQL compare, an OLAP query using a ROWNUMBER() over the data ordered by RRN() from each file could be compared using the EXCEPT keyword; an adaptation of a UNION ALL query in the following past discussions [links below], optionally performed within the db2 utility of the QSHell for which possibly to avoid an output file. If an output file is required, e.g. from which a Retrieve Member Description (RTVMBRD) might be used to get the Current number of records to determine the result, probably there would be little benefit in the SQL over Compare Physical File Members (CMPPFM).
<http://archive.midrange.com/midrange-l/201304/msg01365.html>
<http://archive.midrange.com/midrange-l/201101/msg00874.html>


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.