Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Check if two programs are exactly the same.

702 views
Skip to first unread message

SanderP

unread,
Dec 12, 2007, 4:44:52 AM12/12/07
to
All,

Is there a possibility to check if two RPGLE programs, with the same
name, are also exact copies of eachother??

My first thought is to check the Object Creation Date and Time, but if
you "copy" a RPGLE program from one library to another with CRTDUPOBJ,
this date and time are different for both of the programs.
Is there another way to check if both programs are exactly the same,
besides this creation date and time??

Thanks

Jonathan Bailey

unread,
Dec 12, 2007, 7:03:56 AM12/12/07
to

You could save both objects to the ifs then do a 5 to view the file &
F10 to show hex. Or dmpobj, dmpsysobj.
I expect you would get a few errors comparing by hand, the qsh program
cmp might help you out here.

Jonathan

CRPence

unread,
Dec 12, 2007, 10:54:43 AM12/12/07
to
DMPOBJ and DMPSYSOBJ show only the program *object* which is not,
does not include, the instruction stream.

I am also not clear on how or what is meant by 'save both objects to
the ifs' since /QSYS.LIB *PGM objects are not capable to be stored in
other file systems.? Program objects are not even exposed via the IFS
outside the i5/OS.? Option 5=Display is not even supported against any
objects /QSYS.LIB/*.LIB/*.PGM .? Or maybe I am missing something.?

Just like for OPM (Original Program Model), the "Source file change
date/time" and [from DSPOBJD] the "Object control level" if the compiler
and binder were so kind as to have generated one -- for ILE, a similar
value to the "Object control level" may exist, and for some user created
programs I believe the Copyright field is sometimes used. Thus I would
suggest that DSPPGM DETAIL(*ALL) OUTPUT(*PRINT) and comparing those is
likely the best bet, expecting to compare the Source file change
date/time and possibly something that serves as an effective control
level. For SQL programs, use PRTSQLINF in addition to DSPPGM.

But I wonder... It should be moot if one is an exact copy of
another.? That is, just make such a copy, if that is desired; why
wonder, when it is possible to just /make it so/ ?

Regards, Chuck
--
All comments provided "as is" with no warranties of any kind
whatsoever and may not represent positions, strategies, nor views of my
employer

Jonathan Bailey wrote:
> On Dec 12, 9:44 am, SanderP <SANDERPULL...@hotmail.com> wrote:
>>
>> Is there a possibility to check if two RPGLE programs, with the same
>> name, are also exact copies of each other??
>>
>> My first thought is to check the Object Creation Date and Time, but if
>> you "copy" a RPGLE program from one library to another with CRTDUPOBJ,
>> this date and time are different for both of the programs.
>> Is there another way to check if both programs are exactly the same,
>> besides this creation date and time??
>

Denny

unread,
Dec 12, 2007, 10:56:38 AM12/12/07
to
I wish there was a fool proof method.

The best I have found is to do a DSPPGM on each program object, press
enter twice to display the modules that the program was created from.

Enter a 5 by the module name and you can see the Lib/srcfile member
and date/time member changed.

So you can determine if they were created from the same source.

If the source date/time stamp is different, then the programs are
probably different. Save/restore or CRTDUPOBJ will preserve the
change date/time in a source file but CPYF or CPYSRCF will reset it.

Denny

Jonathan Bailey

unread,
Dec 13, 2007, 5:49:43 AM12/13/07
to
On Dec 12, 3:54 pm, CRPence <crpe...@vnet.ibm.com> wrote:
> DMPOBJ and DMPSYSOBJ show only the program *object* which is not,
> does not include, the instruction stream.
>

Thought so - I should have put a question mark after that bit. You do
get some interesting stuff from CLPs though.

> I am also not clear on how or what is meant by 'save both objects to
> the ifs' since /QSYS.LIB *PGM objects are not capable to be stored in
> other file systems.? Program objects are not even exposed via the IFS
> outside the i5/OS.? Option 5=Display is not even supported against any
> objects /QSYS.LIB/*.LIB/*.PGM .? Or maybe I am missing something.?
>

I wasnt thinking clearly - but If you were to ftp the savf into the
ifs in the 'usual' way then cmp should work, maybe? You would get
differences in the saved date, & all those other object header items
but these would most likely be pretty obvious. If you do find
differences its going to be hard to figure out what it means anyway.

Jonathan

SanderP

unread,
Dec 13, 2007, 6:17:09 AM12/13/07
to
Thanks all for thinking with me.

Actual reason why we need this, is to see if we have any differences
in program-objects between our Production and Test Machine.
Our plan was to keep a file which holds the creationdate and -time per
object and per machine.
Since we're duplicating the objects with CRTDUPOBJ from one machine to
the other, these date and time are changed.
I think we will change the CRTDUPOBJ to a RSTOBJ, because in this case
the creationdate and -time of both objects will remain the same.

But it would be nice if there was a proper way to just check if two
program-objects are exactly the same.

Thanks

0 new messages