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



Booth,

Take any program you ran CRTBNDRPG against. Basically any RPG program you have defined as RPGLE or SQLRPGLE.
Now run this command on it:
DSPPGM PGM(ROB/AAA) DETAIL(*MODULE)
You will see that even that creates a module, temporarily.
So, in effect, that program is a single module program.
A single program can be composed of multiple modules. But instead of CRTBNDRPG you use CRTRPGMOD and/or CRTCLMOD and bind those together with CRTPGM. CRTBNDRPG is just basically a combination of CRTRPGMOD and CRTPGM.

Now, many service programs could be bound to that program, even if you didn't tell it to. Try this command
DSPPGM PGM(ROB/AAA) DETAIL(*SRVPGM)
And you will see the service programs bound to that program.

A good baby step.
Move a subroutine to a subprocedure. Make sure it has clearly defined input(s) and returns one variable. Throw in some local variables for grins and giggles.
Use that in a program.
Now move that subprocedure into it's own source member. Instead of CRTBNDPGM run CRTRPGMOD. Now you have a separate module. You can create a new service program containing that module with CRTSRVPGM. Or you can add that module to one of your existing service programs with UPDSRVPGM.
Now you can bind that new service program to a RPG program when you compile it. Study up on this stuff
H Bnddir('ROUTINES/SRVPGM':'QC2LE')
H ActGrp(*CALLER)
H DftActGrp(*NO)

Binder language is another thing to learn. The trick to binder language is to accept that it is incredibly easy. So easy you won't believe it's that easy. So easy that even after reading a redbook, and attending a class on it and you go to a session at COMMON it finally sinks in that, yes, it's that easy.
Jon Paris autographed my Redbook at that session with "I thought you knew this stuff?" I still have that redbook.


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vernon Hamberg
Sent: Monday, January 21, 2019 9:05 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Beginning modules, procedures, and service programs.

Booth

You don't mention that you read anything from IBM - they have the ILE Concepts manual
(https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/ilec/sc415606.pdf)


and an ILE Example manual
(https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_61/books/sc415602.pdf)

You might need to copy the links in pieces and reassemble to paste into a browser.

I think I'd start with the example - you don't need to grasp everything in the concepts, but maybe look at that, first, at the first few concepts - the basic stuff.

Others can certainly modify my suggestion - I'm shooting from the hip.

HTH
Vern

On 1/20/2019 3:14 PM, Booth Martin wrote:
I finally decided to move towards the 21st Century.  The whole idea of
prototypes, modules, service programs, and ILE concepts has been a
curiosity to me and avoided by me.  But no more.  I have been reading
articles, looking at examples, and working with service programs.  It
still bewilders me

May I say back what I think I have learned, with the idea that I
probably got much of it wrong?  I am barely past Hello World, and much
of what I read is targeted to a level somewhere above that. I need to
get my basics right.   (I appreciate the patience and the talent here
o Midrange.com)'

Typically  I have made a series of small programs to do the various
activities needed for an application.  There would be a program to
create the file(s) needed for the application, the program to edit
those files,  program(s) to communicate the data to & from users,
ancillary programs for F1-Help, F4-Prompt, etc., and the display files
to go with all of that.

If I understand correctly, the programs and their display files would
now become modules?   A service program would be written to combine
those new modules?  There would be another service program for the
wider-scope activities, like default values, message files, and
communications applications.

At that point every thing starts to fall apart in my head.  So let me
offer a simple situation and ask what pieces should I create for that
situation:

NameFile, with name, street, city, state, zip, phone, and email. I
need to create the file, edit the file (including a default for
message file for language-to-use, dropdown (F4) on state, and an F1
key for system-wide Help defaulting to NameFile help).  I also want to
provide F4 screens for name, city, & state so other applications can
plug in dropdowns for valid name, city, & Sates for their own
applications needing name & address info.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.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.