× 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: Off topic: compiling ILE modules
  • From: "Scott Klement" <infosys@xxxxxxxxxxxx>
  • Date: 04 Jan 2000 11:50:06 -0600

Hi,

Jimbo <james.rich@m.cc.utah.edu> wrote:
>
> Hi everyone,
> Sorry about the offtopic, I don't know where else to go.

Assuming (based on your example) that you're wanting to do this
in ILE RPG/400, the correct "place to go" would be the RPG400-L
mailing list.

You should be able to sign up on this list at www.midrange.com.
I also participate in the RPG400-L list, and yes, people on that
list will be able to answer your question.
>
> At my work we have always used the old style method of building
> programs:  One source member = one executable.  The whole program
>  lives
> in one source member.  Yuck.  If we want to call another program to
> something we use to old style call which causes a program bootstrap
>  for
> every call.  Something like this:
>
> C                   call      'CS0007IR'
> C                   parm                    selectcst#
> C                   parm      '01'          selectco#
> C                   parm      '0'           allowdelet
> C                   parm                    cs0007rtn
>
> This way sucks because of the slowness of the call and the lack or
> parameter checking.  Plus you can't do C-like things such as :
>
> if((check_me(some_data)) == ERROR)
> { do something }
>
> So I want to do what I think are called bound procedure calls.
> Basically I want to do what any C compiler can do (and IBM claims an
> ILE language can do):  make a bunch of object files (*.o stuff) and
>  link
> them all together to create an executable.  I must have ILE Concepts
> dozen times and IBM seems to be writing gibberish.  Not a standard
> definition of any term in the whole book!  I think I need something
> binding directory (what is that?) and some way to say this object an
> that object link to together to make an executable.  Anyone know how
>  to do this?  Can you bring our office out of the dark ages?

The difference between what you're used to on UNIX and what the
AS/400 does is pretty much just a matter of terminology.  On the
AS/400, you create multiple "modules", and "bind" them.  On UNIX
you create multiple "objects (*.o)" and you "link" them.

Instead of having a "shared library", you have a "service program".
But they all pretty much amount to the same thing.

Start by learning and understanding Prototypes & Sub-procedures in
RPG.  Once you've gotten the hang of that, then look at using the
NOMAIN keyword, and the EXPORT keyword to create MODULES.

Then use CRTPGM or CRTSRVPGM to bind them into either programs or
service programs.

Here's a basic example of a sub-procedure, coded in-line (not in
a seperate module)

D check_me        PR            10I 0
D   first_arg                   50A

C                   if        check_me(some_data) < 0
c*     .... handle error condition ....
c                   endif

P check_me        B
D check_me        PI            10I 0
D   first_arg                   50A
C                   if        first_arg = 'whatever'
c                   return    1
c                   else
c                   return    0
c                   endif
P                 E

Again, if you want to continue this discussion, or get more detailed
information, please switch over to the RPG400-L mailling list!

Good Luck!

+---
| This is the LINUX5250 Mailing List!
| To submit a new message, send your mail to LINUX5250@midrange.com.
| To subscribe to this list send email to LINUX5250-SUB@midrange.com.
| To unsubscribe from this list send email to LINUX5250-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 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.