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


  • Subject: Re: Incorrect module name and library
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Fri, 2 Mar 2001 14:49:29 -0600 (CST)


You seem to have the name of the *MODULE object mixed up with the name 
of the procedure.   By default, the "main procedure" of a module is named
the same as the module -- however that doesn't make them the same thing!

Let me try explaining this another way.   In C, if you have a program
called "MYPGM", compiled from "MYMOD", the first procedure that will be
called when the program starts is called "main".   Thats the way C works,
the first procedure is always called "main".  If you renamed the module
from "MYMOD" to "MYMOD2" the first procedure in it would STILL be called
"main".  Why?  Because thats the name the procedure was assigned when it
was compiled.  

In RPG, if you have a program called "MYPGM" made from a module called
"MYMOD", the first procedure that it calls is also called "MYMOD".  
When you rename the module object from "MYMOD" to "MYMOD2", the procedure
is STILL called MYMOD.  Why?  Because thats the name the procedure was
given when it was compiled.   Remember that neither *MODULE objects nor
the RNMOBJ command are RPG specific!

It seems to me that you should either be trying to find out the MODULE
name (rather than the procedure name) or you should changing the proc
name in source.   


On Fri, 2 Mar 2001, M. Lazarus wrote:

> Jon, Barbara, et al,
> 
>   I came across some ILE anomalies that I found interesting and could be a 
> bug (or two).  This is under V4R5 and possibly under V4R4.
> 
> 1)   I created a program (PGM) and bound module MOD into it. I then made a 
> copy of the MOD source and called it MOD_TEST.  I made some changes (not to 
> the interface), created module MOD_TEST, renamed module MOD_TEST to MOD, 
> updated PGM via UPDPGM PGM MOD.
> 
>   Within the program I have an SDS that specifies a *PROC variable.  The 
> value printed is MOD_TEST, not MOD, which is the current name.  This tells 
> me that this value is populated at compile time, not runtime.  Is this the 
> way OPM programs worked?  I seem to recall that it was at runtime.  This 
> behavior was a surprise to me.  I would think that most people would want 
> the current name of the module, not the original name.
> 
> 
> 2)  Using a similar scenario as above, where the module was updated via 
> UPDPGM, I ran
> DSPPGM PGM DETAIL( *MODULE ) and put a 5 next to the module to display the 
> details.  The library displayed is that of the ORIGINAL module, not the 
> current module!  All other information seems to have gotten updated, 
> including the source file / library and member.  This would definitely seem 
> to be a bug to me.
> 
>   -mark
> 
k

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.