× 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: module name and library
  • From: bmorris@xxxxxxxxxx
  • Date: Fri, 2 Mar 2001 16:40:51 -0500
  • Importance: Normal


Date: Fri, 02 Mar 2001 10:45:39 -0500
From: "M. Lazarus" <mlazarus@ttec.com>
>
>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.

Mark, *PROC doesn't give the module name; it gives the name of the main
procedure (which is the same as the name of the module when the module was
first created).  If you do a DSPMOD, you will see that the procedure
exported from MOD is MOD_TEST.

(Actually, with NOMAIN modules, *PROC doesn't have the name of the
main procedure, since there isn't a main procedure.  Instead, it has
the name that the main procedure would have had, had there been one.)

If you want the module name from the PSDS, look in 344-353 (right after
the program name).

Think of a module like a library.  If you have a library A with program
A, you wouldn't expect the program's name to change if you changed the
library name.

But it's not exactly the same.  Once the module is created, the number
and names of the procedures can't be changed.  RPG is a bit odd - it
doesn't allow you to name the main procedure - it derives it from the
module name when the module is created.  This was to make it easy to
change all your CALLs to CALLB and create modules instead of programs
and have everything work the same.  Unfortunately, it led to this
common misconception that you can call modules (which you can't).

Barbara


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

Follow-Ups:

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.