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



The critical things to remember are that a) Globals (unless imported/exported) belong to the MODULE. The Service Program is irrelevant to the discussion. and b) Storages always belong to the job. Other than User spaces etc.

The only way the SP would really come into play is if it is defined to run *CALLER and is subsequently called by programs running in (say) ActGrpA and ActGrpB. Now you have two copies of the Globals.

So if you want to guarantee that there is only one copy per job - the the SP should run in its own AG.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Apr 30, 2019, at 6:30 PM, Raul Jager <raul@xxxxxxxxxx> wrote:

That is what I need, to retain the values in each job, but have
different values in other jobs, even if both are running simultaneous.

On 4/30/19 5:59 PM, Alan Campin wrote:
Each module has it own static storage within that module within a
activation group within a job.

So if another program within the job same job calls the service program,
the first time a procedure within a module is called, the storage is
activated.

The next a program within that job call it see the storage that was
activated before so if you want different jobs seeing storage in another
job you are going to have to provide a method to share it like shared
memory api, user spaces or user indexes or database tables.


On Tue, Apr 30, 2019 at 2:52 PM Raul Jager <raul@xxxxxxxxxx> wrote:

In a service program the global variables are shared by all the
functions, for sure in the same call.

Will they keep their value if a RPG program calls a different
function? It seems yes, but always?

If other job calls a function, will it have its own values?

My goal is to write several functions and use the values of previous
calls. It will work if I pass the values as parameters, can I omit the
parameters, and still have the values?


-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --
--
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


-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --
--
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 ...


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.