Published on System iNetwork (http://systeminetwork.com)
Comparing Libraries
By tzura
Created Apr 26 2001 - 04:00

Q. I have two data libraries on my AS/400, one of which contains test data and the other live data. Each library contains thousands of files. What's an easy way to see which files exist in one library but not the other?

A. Here are the steps for comparing the differences between two libraries (in this example, we're using the names library1 and library2):

a. DSPOBJD OBJ(library1/*ALL) OBJTYPE(*ALL) DETAIL(*BASIC) OUTPUT(*OUTFILE) OUTFILE(mylib/LIBR1)

b. DSPOBJD OBJ(library2/*ALL) OBJTYPE(*ALL) DETAIL(*BASIC) OUTPUT(*OUTFILE) OUTFILE(mylib/LIBR2)

c. To view the objects in library1 that don't appear in library2, run the query

SELECT * FROM mylib/LIBR1 WHERE ODOBNM NOT IN (SELECT ODOBNM FROM
mylib/LIBR2)

d. To view the objects in library2 that don't appear in library1, use

SELECT * FROM mylib/LIBR2 WHERE ODOBNM NOT IN (SELECT ODOBNM FROM
mylib/LIBR1)

There is also at least one commercial software package that includes a utility that compares two libraries:

AS/400 Utilities from Prospero Software Products http://www.prosperosoftware.co.uk [1]

The above was adapted from newsgroup answers by Walter Bennett and Chipper Miller

© 2010 Penton Media, Inc.

Source URL: http://systeminetwork.com/node/60541

Links:
[1] http://www.prosperosoftware.co.uk